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

Jan Stránský posted a new comment:
Hi Bruno,


> def printIt(): print O.iter
> globals()['printIt']=locals()['printIt']  #anyone knows a better way?
> O.engines=[PyRunner(command='printIt()',iterPeriod=1)]
> O.run(1)
>

you can directly use

globals()['printIt'] = printIt

without calling locals (slightly "better" way). Maybe it would be possible
to create some makeGlobal function for this purposes.
cheers
Jan

PS: When labeled engines are created, the variable is assigned as
__builtin__ module variable, accesible the from any scope

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.

_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to