fork download
  1. import pickle
  2.  
  3. try:
  4. with open('file.dat', 'rb') as f:
  5. words = pickle.load(f)
  6. except:
  7. words = []
  8.  
  9. for i in words:
  10. print(i)
  11.  
  12. words.append(input())
  13. with open('file.dat', 'wb') as f:
  14. pickle.dump(words, f)
  15.  
Runtime error #stdin #stdout #stderr 0.02s 28096KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 12, in <module>
EOFError: EOF when reading a line