← Back to team overview

yade-users team mailing list archive

Re: [Question #293179]: 'Name error' while calling function

 

Question #293179 on Yade changed:
https://answers.launchpad.net/yade/+question/293179

    Status: Answered => Solved

subha confirmed that the question is solved:
Thanks Klaus!

It worked when executed with yade "filename.py".

Just wondering what is the difference when the script is run using
execfile("filename.py") and yade "filename.py" because the former one
works fine when no function is added.

Just another comment, I wanted to save both snapshots and data at the
same time using PyRunner and for that purpose, I added the following
lines to the script:

O.engines+=[PyRunner(iterPeriod=100,command='saveImg()'),
 PyRunner(iterPeriod=5,command='plotAddData()')]

and defined the image saving function as:

def saveImg(): 
 qt.SnapshotEngine(fileBase='/home/subhasish/YADE/tutorials/image/img-')

The geometry is shown in runtime as before:

#show geometry:

v=qt.View(); v.axes=True
v.viewDir=Vector3(0,1,-.05)
v.eyePosition=Vector3(0,-5,.5)

The script, however, does not save any runtime image.

Any suggestion will be appreciated.

Regards,

Subha

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.