I am having a problem with a file i am writing too, basically what i want it to do is, i got a input() saying "enter your name: " stored in a variable, now i created the file wrote what i wanted and based on what the person has input() i wanna place that information into the file on a specific line...
This is what i did to do it and it works, but it is overwriting current text rather then inserting the text and shifting the current text over...
eg;
index = open('index.html' 'w')
index.write(""" blah blah blah
blah blah blah
blah """)
index.seek(20)
index.write(variable)
index.close()
now all i want the variable to do is go into the file like it is doing but not overwrite current text, any advice would be appreciated.
I am using Python3.2.