how to show simulation at web
Apoptozinho
apoptozinho at gmail.com
Tue Jun 7 07:46:32 EDT 2005
If your problem is plotting graphics from numerical simulations perhaps this
fragment of code from my learning python and mod_python may help you.
def show(req):
req.content_type="image/png"
put,get=os.popen4('echo "set term png size 400,400 ; set out ;
splot(sin(x)*cos(y))" | gnuplot')
img=get.read()
req.write(img)
put.close()
get.close()
return apache.OK
I feel there must be an easier, more elegant and performant method of doing
this.
On Monday 06 June 2005 10:57, Hallo (Ha) wrote:
>hi all,
>
>I have tried making a simulation with python. I want it to be shown at
>a web. It is ok when I run it. so, I decided using cgi. but, when I try
>it using a web browser it doesn't work.
>
>Is it problem in the header or something else ?
>
>If there are any suggestions about this problem, I will be very happy.
>
>thanks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20050607/88f1b0ea/attachment.sig>
More information about the Python-list
mailing list