To executed a "whole file" you need to wrap it as a function --
def foo( self ):
and call foo as an external method. The self argument gives the context.
Python provides several modules which give access to execute bash
commands, linux commands, etc. Look at the modules subprocess and
On Tue, 28 Feb 2006, Alric Aneron wrote:
> I see I can only execute python functions in external methods.
> Is there any way to execute the whole file, not just a certain function? In
> linux I created a python script, and it doesn't have functions. I just want
> to execute the whole file. I tried using "self" or "init" for function names
> in Zope and it doesn't want to do it, telling me "The specified object, init,
> was not found in module, test."
> Is there a way to execute a file?
> (another question: is there a way to execute bash commands in linux? or is
> external methods only good for python?)
Zope maillist - Zope@zope.org
** No cross posts or HTML encoding! **
(Related lists -