serialize a tkinter thing

M

max(01)*

hi.

i tried to serialize a list of StringVar's, but i got a pickle error.

this got me to thinking that tkinter objects are not picklable (in general).

would somebody confirm and/or give examples?

thanks

macs
 
J

jepler

I suspect you're right. Tkinter.Variable holds a reference to the tkapp
instance, which doesn't seem likely to be picklable. Imagining that tkapp
instances *were* picklable, unpickling the stringvar would get you a whole new
application toplevel that you didn't want.

You might be able to extend pickle in some clever way to make it work, but it
would probably be easier and less fragile to arrange to pickle something that
is not composed of Tkinter.Variable instances.

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFCWSwtJd01MZaTXX0RAgzwAKCCv/SAH7FrFK8wVIa5nLQ/aICftQCfYgf/
fuvJAgJwxqaBUWyGDeIfGMk=
=5Ro/
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,234
Messages
2,571,178
Members
47,809
Latest member
Adisty

Latest Threads

Top