From: Dethe E. <de...@li...> - 2006-03-06 23:30:46
|
VPython doesn't have a built-in way to save the state as a python program. It shouldn't be terribly hard to create one, but there isn't anything built-in as far as I know. Unfortunately, VPython objects don't appear to be picklable (because the underlying Boost objects are not pickleable), so you can't even use the shortcut method of saving your state with the shelve module. You would probably have to walk the tree of objects and convert the state of each object to a string which, when run, would restore the original object. Tedious, but not difficult. -Dethe On 3/6/06, Andrey Antonov <an...@uc...> wrote: > Dear Friends, > > All of us enjoy the VPython environment. Little by little gaining the > experience we want to create some scripts in Python for building one or m= ore > scenes full of objects. > I am a math high school teacher. It would be better for my (or our) stude= nts > to save their scenes and use them in their next lessons. To be more speci= fic > I mean saving the scene in a file for example using the output of the > command: > scene.objects > Could anyone help me to solve this problem. Any hints, links ang suggesti= ons > are welcome. > I joined the VPython user list from last May 2005 and didn't meet > discussions on this topic. > > ThX in advance > > Andrio > Math teacher > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting langua= ge > that extends applications into web and mobile media. Attend the live webc= ast > and join the prime developer group breaking into this new coding territor= y! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |