Chris, thanks for your help...I tried your suggestion but it has now returned the error Error Type: NameError Error Value: global name '_' is not defined If you have time, would you mind explaining what "_" represents? Is this defined in a library that we mightn't have included? Thanks again, Shaneo ----- Original Message ----- From: Chris Kratz To: Shane O'Sullivan ; zope@zope.org Sent: Tuesday, October 30, 2001 4:26 PM Subject: Re: [Zope] calling dtmlMethod from python I ran into this awhile back. Try this: context.scReport(None, _) Interestingly enough, I also learned that you can pass things into a dtml-method and they become available to use internally. For example with the following call: context.scReport(None, _, MsgToUser='Hello') Inside your dtml-method you could do a <dtml-var MsgToUser> This is very usefull to passing stuff around without cluttering up your REQUEST namespace. Another little trick I learned. Want to find an object via acquisition and then call it? I found that the following worked in a python script: methodToCall = _.getitem('methodName') # Find object via acquisition and get handle on it. print methodToCall(None, _) # Call the method and print the results. This is really usefull if you generate the method name as I do depending on the request. ie methodToCall = _.getitem(someStrVar + 'form') will concatenate the two strings and then look for that object in the namespace. If you do this kind of lookups, you should probably also check for existence before calling it, ie _.has_key(someStrVar + 'form'). Hope that helps. -Chris ------------------------------ Chris Kratz chris.kratz@vistashare.com ----- Original Message ----- From: Shane O'Sullivan To: zope@zope.org Sent: Tuesday, October 30, 2001 11:13 AM Subject: [Zope] calling dtmlMethod from python Can anyone please help with this, I'm new to zope and trying to write a simple python script to handle some logic which will then call a dtml method. I'm calling the method as such: context.scReport() The error I'm getting back is Error Type: KeyError Error Value: standard_html_header standard_html_header is being called from the scReport method which suggests the scReport method is being invoked but why are we getting an error?? Any suggestions, TIA Shaneo