← Back to team overview

yade-dev team mailing list archive

Re: Interesting python usage

 

> Why calling PyRun_SimpleString("print O.bodies[1].state.pos") in my yade C file works, but not calling it through a function defined in another script file:
"doesn't work" is not error message. Be more precise.

I still don't understand why you don't use PeriodicPythonRunner with
commad="execfile('abc.py')"; you could also import your file as module
(see help for sys.path) and run function from there as
command="yourmodule.function()". No need to go through C, PPyRunner does
that for you already.





Follow ups

References