I am writing a program that is going to run a lot of print output. All I'm really looking to do is have certain pieces of that print output, written directly into my program after it is closes.
Think as if there were a 'save()' function the likeness of the 'print()' that would work like this:
string = "#this my generated comment"
save(string,line)
Line would of course be the line where you want the string saved into the program. Now bare in mind, I don't just want to be limited to adding comments, I would like code that will execute the next time that new line is called.
If the only way to do this is to save the file, edit it and then reload, that is fine. A basic walk-through would be greatly appreciated,
Edit: Alternatively, I am not opposed to the idea of saving the added line into another file and then importing it from the program.
thanks,