Python Forum
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Saving
#11
(Jun-08-2018, 02:05 PM)buran Wrote: you are kidding, right? https://docs.python.org/3/tutorial/input...le-objects and https://docs.python.org/3/tutorial/input...-with-json if you want to use json (better, because you get structured data) there are numerous examples how to read and write to file
Believe me, the sooner you learn to use the docs, the better
Can i just get a straight answer? I followed EXACTLY what the document said and got an error.

I tried something different and got an error:
import pickle
control = True
control = Control(...)
with open('savefile.dat', 'wb') as f:
    pickle.dump([control], f, protocol=2)
And got the error
Error:
Control is not defined
So i changed the code to this
import pickle
control = True
control = control(...)
with open('savefile.dat', 'wb') as f:
    pickle.dump([control], f, protocol=2)
And got the error
Error:
'bool' object is not callable
Self-taught HTML, CSS, Python, and Java programmer
Reply


Messages In This Thread
Saving - by Panda - Jun-07-2018, 06:36 PM
RE: Saving - by buran - Jun-07-2018, 07:00 PM
RE: Saving - by Panda - Jun-08-2018, 12:23 PM
RE: Saving - by buran - Jun-08-2018, 12:37 PM
RE: Saving - by Panda - Jun-08-2018, 12:54 PM
RE: Saving - by buran - Jun-08-2018, 12:57 PM
RE: Saving - by Panda - Jun-08-2018, 01:09 PM
RE: Saving - by buran - Jun-08-2018, 01:12 PM
RE: Saving - by Panda - Jun-08-2018, 02:00 PM
RE: Saving - by buran - Jun-08-2018, 02:05 PM
RE: Saving - by Panda - Jun-08-2018, 02:43 PM
RE: Saving - by Grok_It - Jun-23-2018, 11:50 PM
RE: Saving - by Panda - Jun-24-2018, 12:24 AM
RE: Saving - by Grok_It - Jun-24-2018, 01:02 AM
RE: Saving - by Panda - Jun-24-2018, 01:18 PM
RE: Saving - by Grok_It - Jun-24-2018, 02:55 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020