[mod_python] mod_python and execfile

amit amit at digitalpeers.com
Mon Jun 20 18:20:44 EDT 2005


Thanks for the reply Lee,

 But this doesn't help, I already have the 'req.content_type = ...' in 
the main script. (I simplified the script in the original mail)

def handler(req):
	req.content_type = 'text/plain' 
	...
     	execfile(req.filename, {'req':req})


Amit

Lee Brown wrote:

>Greetings!
>
>Always the first thing to try when nothing appears in the browser:
> 
>def main():
>	req.content_type = 'text/plain' 
>   	req.write('Hello there!')
>
>Best Regards,
>Lee E. Brown
>(administrator at leebrown.org)
>
>-----Original Message-----
>From: mod_python-bounces at modpython.org
>[mailto:mod_python-bounces at modpython.org] On Behalf Of amit
>Sent: Monday, June 20, 2005 2:59 PM
>To: mod_python at modpython.org
>Subject: [mod_python] mod_python and execfile
>
>Hello,
>
>    I am using mod_pyton to write a collection of scripts. And I am facing
>the following problem:
>I use the handler to execute a script. And I try to pass the req object to
>it:
>
>def handler(req):
>     execfile(req.filename, {'req':req})
>
>in the script I have the following code:
>
>def main():
>    req.write('Hello there!')
>
>I know that the script is executed but I don't get the 'hello there!' 
>message in my browser. Can anyone help?
>
>Thanks
>    Amit
>
>_______________________________________________
>Mod_python mailing list
>Mod_python at modpython.org
>http://mailman.modpython.org/mailman/listinfo/mod_python
>
>
>
>  
>



More information about the Mod_python mailing list