[Tutor] how to read and write to a file
krush1954 at yahoo.com
Wed Jan 25 13:19:15 CET 2012
I would like to write to and read from a file from python. I wanted to use the file to save input to the program in a list. I have been looking around and there seems to be several ways to go about it. I tried pickling, but am having an issue with it. What would be the correct way to accomplish this? I have tried several ways, but to no avail. I get no error msg. but the list isn't retaining the info. Is pickling even the best way to do it.
file1 = open("ArtyKlikes.p", "ab") # likesList
file2 = open("ArtyDislikes.p", "ab") # dislikes
Any help would be greatly appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor