cgi python
Hi Christian, I have seen your well-solved cgi-python answers. That's why I think you would be able to answer my query related to the same. I am writing a cgi program and placing it in cgi-bin folder of Apache Server. Now I have written a python script in the same folder to generate a graph 'genebarchart.py'. When I run this program from shell, i.e., C:\Program Files\Apache Group\Apache2\cgi-bin>python genebarchart.py it runs well and creates the graph in htdocs folder as I save the graph there using a save command within the python script, but when I use the os.system command to call the python script within the cgi-code, i.e., os.system ("python genebarchart.py") as both the scripts are in the same folder, it doesn't creates the graph in htdocs folder. Can u please tell me why? Thanks, Piyali -- http://mail.python.org/mailman/listinfo/python-list
plz sort this out
Hi, I am using networkx and pylab for creating a graph using a python script abc.py. I have saved the networkx folder in "C:/Python24/Lib/site-packages". When I run the script from command prompt, it creates the graph and saves it to the place I want to but when I write a python-cgi script and run it as os.system('python abc.py') it doesn't gives me any result. I have included the path of my system using os.environ['PATH'] = ".". I also appended the path of networkx directory using sys.path.append('C:/Python24/Lib/site-packages') as it seems to me that it is a path related problem and the cgi result page shows error (1) networkx *undefined* (2)* *drawing undefined (3) nx_pylab *undefined* (4) matplotlib *undefined* *(5) raise RuntimeError("'%s' is not a writable dir; you must set environment variable HOME to be * * a writable dir "%h)* Can you please tell me how to enable cgi to run this program on runtime. I have kept both the cgi script as well as python script in Apache/cgi-bin folder. Thanks, Piyali -- http://mail.python.org/mailman/listinfo/python-list
please sort this out
Hi, I am using networkx and pylab for creating a graph using a python script abc.py. I have saved the networkx folder in "C:/Python24/Lib/site-packages". When I run the script from command prompt, it creates the graph and saves it to the place I want to but when I write a python-cgi script and run it as os.system('python abc.py') it doesn't gives me any result. I have included the path of my system using os.environ['PATH'] = ".". I also appended the path of networkx directory using sys.path.append('C:/Python24/Lib/site-packages') as it seems to me that it is a path related problem and the cgi result page shows error (1) networkx *undefined* (2)* *drawing undefined (3) nx_pylab *undefined* (4) matplotlib *undefined* *(5) raise RuntimeError("'%s' is not a writable dir; you must set environment variable HOME to be * * a writable dir "%h)* Can you please tell me how to enable cgi to run this program on runtime. I have kept both the cgi script as well as python script in Apache/cgi-bin folder. Thanks, Piyali -- http://mail.python.org/mailman/listinfo/python-list
Re: please sort this out
hi all, I solved the problem with the help of python cookbook+matplotlib I was getting the main error as * raise RuntimeError("'%s' is not a writable dir; you must set environment variable HOME to be * * a writable dir "%h)* Matplotlib needs the environment variable HOME to point to a writable directory.Thats why i did os.environ[ 'HOME' ] = 'C:/temp' and the cgi-script worked. For further questions about cgi+matplotlib/networkx please see http://www.scipy.org/Cookbook. Its very useful Thanks, Piyali Biswas On 4/16/07, piyali biswas <[EMAIL PROTECTED]> wrote: Hi, I am using networkx and pylab for creating a graph using a python script abc.py. I have saved the networkx folder in "C:/Python24/Lib/site-packages". When I run the script from command prompt, it creates the graph and saves it to the place I want to but when I write a python-cgi script and run it as os.system('python abc.py') it doesn't gives me any result. I have included the path of my system using os.environ['PATH'] = ".". I also appended the path of networkx directory using sys.path.append('C:/Python24/Lib/site-packages') as it seems to me that it is a path related problem and the cgi result page shows error (1) networkx *undefined* (2)* *drawing undefined (3) nx_pylab *undefined* (4) matplotlib *undefined* *(5) raise RuntimeError("'%s' is not a writable dir; you must set environment variable HOME to be * * a writable dir "%h)* Can you please tell me how to enable cgi to run this program on runtime. I have kept both the cgi script as well as python script in Apache/cgi-bin folder. Thanks, Piyali -- http://mail.python.org/mailman/listinfo/python-list
solved
hi all, I solved the problem with the help of python cookbook+matplotlib I was getting the main error as * raise RuntimeError("'%s' is not a writable dir; you must set environment variable HOME to be * * a writable dir "%h)* Matplotlib needs the environment variable HOME to point to a writable directory.Thats why i did os.environ[ 'HOME' ] = 'C:/temp' and the cgi-script worked. For further questions about cgi+matplotlib/networkx please see http://www.scipy.org/Cookbook. Its very useful Thanks, Piyali Biswas -- http://mail.python.org/mailman/listinfo/python-list