Hello, I try to define some helper functions inside of a `Python Script` (PS). Simplified example: # def fa(): print 'fa executed' def fb(): fa() fb() return printed # This does not work, as the PS itself is apparently not a module level namespace. I can call fa() directly, although. Is there some way to call a function defined in the PS inside another function? Is there something like the PS namespace? TIA, __Janko
On Sunday 04 March 2001 14:22, Janko Hauser wrote: Hello, I try to define some helper functions inside of a `Python Script` (PS). Simplified example: # def fa(): print 'fa executed' def fb(): fa() fb() return printed # This does not work, as the PS itself is apparently not a module level namespace. I can call fa() directly, although. Is there some way to call a function defined in the PS inside another function? Is there something like the PS namespace? _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Simplified example: # def fa(): print 'fa executed' def fb(): fa() fb() return printed # This does not work, as the PS itself is apparently not a module level namespace. I can call fa() directly, although. Is there some way to call a function defined in the PS inside another function? Is there something like the PS namespace?
I haven't played with python scripts too much but with python methods you would have to declare your functions as global so def fa(): pass def fb(): global fa fa() hth kapil
participants (2)
-
ender -
Janko Hauser