yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #04853
[Question #167511]: utils.saveVars() and utils.loadVars()
New question #167511 on Yade:
https://answers.launchpad.net/yade/+question/167511
Hi,
I want to save some variables with utils.saveVars() and load it in another script with utils.loadVars().
test script 1:
#!/usr/bin/python
# -*- coding: utf-8 -*-
a = 1
b = 2
c = 3
utils.saveVars('savedVars',a=a,b=b,c=c)
test script 2:
#!/usr/bin/python
# -*- coding: utf-8 -*-
utils.loadVars('savedVars')
error message:
Running script save-vars-test2.py
Traceback (most recent call last):
File "/home/me/YADE/bin/yade-bzr2877", line 183, in runScript
execfile(script,globals())
File "save-vars-test2.py", line 3, in <module>
utils.loadVars('savedVars')
File "/home/me/YADE/lib/yade-bzr2877/py/yade/utils.py", line 67, in loadVars
d=cPickle.loads(Omega().tags['pickledPythonVariablesDictionary'+mark])
KeyError: 'Invalid key: pickledPythonVariablesDictionarysavedVars.xml.'
???
Can I save my variables in another way, e.g. with the O.save() ?
--
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.