Python Forum
saving (in text or binary) an object under a defined class
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
saving (in text or binary) an object under a defined class
#2
one way is pickle module from Python Standard Library

here is tutorial on using pickle on Python Module of the week site


Another option is store instance attributes (if possible) as json file (or some other type of text file). In which case you need to create interface to reconstruct the object from that file.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: saving (in text or binary) an object under a defined class - by buran - May-09-2019, 07:28 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Printing out incidence values for Class Object SquderDragon 3 355 Apr-01-2024, 07:52 AM
Last Post: SquderDragon
  error in class: TypeError: 'str' object is not callable akbarza 2 584 Dec-30-2023, 04:35 PM
Last Post: deanhystad
  "Name is not defined" when running a class lil_e 6 4,208 Jan-12-2023, 11:57 PM
Last Post: lil_e
  Saving the print result in a text file Calli 8 1,916 Sep-25-2022, 06:38 PM
Last Post: snippsat
  python update binary object (override delivered Object properties) pierre38 4 1,828 May-19-2022, 07:52 AM
Last Post: pierre38
  saving and loading text from the clipboard with python program MaartenRo 2 1,696 Jan-22-2022, 05:04 AM
Last Post: MaartenRo
  Why built in functions are defined as class? quazirfan 5 2,905 Oct-23-2021, 01:20 PM
Last Post: Gribouillis
Exclamation win32com: How to pass a reference object into a COM server class Alfalfa 3 4,962 Jul-26-2021, 06:25 PM
Last Post: Alfalfa
  How to convert binary data into text? ZYSIA 3 2,688 Jul-16-2021, 04:18 PM
Last Post: deanhystad
  Extracting the text between each "i class" knight2000 4 2,390 May-26-2021, 09:55 AM
Last Post: knight2000

Forum Jump:

User Panel Messages

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