Problem with saveVars

Bug #826176 reported by Anton Gladky on 2011-08-14
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Yade
Invalid
Undecided
Unassigned

Bug Description

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.'

Anton Gladky (gladky-anton) wrote :

The simulation needs to be saved and then loaded to use this function.

https://answers.launchpad.net/yade/+question/167511

Changed in yade:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions