[Zope] External Methods newbie question

Dennis Allison allison at shasta.stanford.edu
Wed Mar 1 00:35:17 EST 2006


To executed a "whole file" you need to wrap it as a function --

	def foo( self ):
		<the script>

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 
commands.  



On Tue, 28 Feb 2006, Alric Aneron wrote:

> Hello,
> 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?)
> 



More information about the Zope mailing list