<html><body><div style="color:#000; background-color:#fff; font-family:bookman old style, new york, times, serif;font-size:12pt"><div><font class="Apple-style-span" face="'bookman old style', 'new york', times, serif" size="3">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&nbsp;</font><font class="Apple-style-span" face="'bookman old style', 'new york', times, serif">several</font><font class="Apple-style-span" face="'bookman old style', 'new york', times, serif" size="3">&nbsp;ways, but to no avail. I get no error msg. but the list isn't retaining the info.&nbsp;</font><span class="Apple-style-span" style="font-family: 'bookman old style', 'new york', times, serif; ">Is pickling even the
 best way to do it.</span></div><div><font class="Apple-style-span" face="'bookman old style', 'new york', times, serif" size="3"><br></font></div><div><font class="Apple-style-span" face="'bookman old style', 'new york', times, serif" size="3"><div>file1 = open("ArtyKlikes.p", "ab") &nbsp;# likesList</div><div>file2 = open("ArtyDislikes.p", "ab") &nbsp;# dislikes</div></font></div><div><font class="Apple-style-span" face="'bookman old style', 'new york', times, serif" size="3"><br></font></div><div><font class="Apple-style-span" face="'bookman old style', 'new york', times, serif" size="3"><div>pickle.dump(likesList, file1)</div><div>pickle.dump(dislikeList, file2)</div><div><br></div><div>file1.close()</div><div>file2.close()</div></font></div><div><font class="Apple-style-span" face="'bookman old style', 'new york', times, serif" size="3"><br></font></div><div><font class="Apple-style-span" face="'bookman old style', 'new york', times, serif"
 size="3">Any help would be greatly appreciated.</font></div></div></body></html>