[mod_python] Mod_python Charts

Jim Gallacher jg.lists at sympatico.ca
Mon Oct 17 09:02:17 EDT 2005


WR - wrote:
> My script is not working yet.
> 
> I have make a other simple example:
> 
> index.htm
> ====
> <p><a href="modules/write.py">test</a></p>
> 
> write.py
> ====
> from mod_python import psp
> 
> def index(req):
>     req.content_type = 'text/html'
>     tmpl = psp.PSP(req, filename='templates/write.tmpl', vars={'req': 
> req, 'psp': psp})
>     tmpl.run()
> 
> 
> write.tmpl
> ====
> <%
> def lezen(inputfile):
>   inputenzyme = open (inputfile, 'w')
>   req.write("Write file, inputfile<br>")
>   inputenzyme.write("test")
>   inputenzyme.close()
>   req.write("Finish")
> lezen("test.txt")
> %>
> 
> 
> RESULTS:
> =======
> I.E. (windows):
> 
> 
> Write file, inputfile
> Finish
> 
> No ERROR
> 
> 
> NO file test.txt is make in the directory?

In what directory? You are depending on whatever apache thinks is the 
current working directory, which may not be what you think it is. As has 
been suggested before, try using an absolute path:

eg. inputfile = '/tmp/test.txt'

Regards,
Jim

> 
> Did I have permission problems? Or are the other problems?
> How can i set this permissions?
> 1. Map ==> right click? change permissions ==> don't work
> 2. change config file apache?
> I'm administror on the windowsdesktop!
> 
> _________________________________________________________________
> Vind alles terug op je PC: MSN Search Toolbar http://toolbar.msn.nl/
> 
> _______________________________________________
> 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