On 16/01/13 02:31, Gina wrote:
new_file = open("the_file_upper.txt", "w+")
In general consider the w+ file option to be for advanced use only.
Either open it for reading or writing, don't try to do both at the same
time. It's a bit like sitting on a tree branch with a saw to cut it
down. If you cut on the wrong side you get hurt...
new_file.write(*****)
print(new_file.read())
This won't read anything because the file cursor is at the end of the
string that you wrote (remember the branch illustration?)
new_file.close()
And this just closes the file with a short line of asterisks in it...
Not really what you want.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor