hello seniors,
i am in need of getting some good tutorial or any helping example by which i can get an idea about how to serialize the objects in wxpython.
your help will be highly appreciated.
Regards
Punter
hello seniors,
i am in need of getting some good tutorial or any helping example by which i can get an idea about how to serialize the objects in wxpython.
your help will be highly appreciated.
Regards
Punter
A short practical guide building on 's question and 's pointer to Python serialization: do not try to serialize live wx objects (Frames, Controls, Menus). wx widgets wrap C++ resources and internal handles that are not reliably picklable and will not survive a simple load/recreate cycle. Instead, persist the application state or model (the data the GUI shows) and recreate GUI controls from that state on startup.
A simple workflow:
pickle); shelve if you want a simple on-disk dict. Save on clean shutdown and restore at startup by applying values back to controls (e.g., set value, selection, size, position).Practical tips and cautions:
to_dict/from_dict pair or __getstate__/__setstate__) so only safe, simple data is written. Relevant documentation: pickle — Python object serialization, json — JSON encoder and decoder, shelve — Python object persistence, wx.FileConfig.
Jump to Post— Stefano Mtangoo 455Just serialize them with Python's pickle or cpickle module
Just serialize them with Python's pickle or cpickle module
thank you for replying.
is it any way so i can get an example or some helping tutorial that can show me how the serialization will be done with pickle or cpickle??
ok,let me check that link.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.