On Jun 1, 1:44 am, [EMAIL PROTECTED] wrote:
> I want to create a program where a user can type what ever they want
> to, have it saved to a file, and the be able to re-open it and read
> it. How would I do this? Thanks!

Use a multi-line text-input widget (available on any widget library)

To open a file in python for reading:
filepointer = file('path/to/file', 'r')

then read it like this:
for line in filepointer:
    dosomethingwith(f)

or:
filecontent = filepointer.read()

To open a file for writing:
filepointer = file('path/to/file', 'w')

to write to a file:
filepointer.write(somestring)

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to