<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="RIGHT: auto">Hi all,</div>
<div style="RIGHT: auto"> </div>
<div style="RIGHT: auto">I've successfully build and install Python MapScript (I get some warnings while building but I don't get any errors). I am trying to run a simple application testing Python MapScript given in Bill Kropla's book. I am able to execute my pytest.py script in command line and can see the generated image in /tmp directory but while I tried using browser (IE 8) to execute it, it just prints my code and doesn't generate image in /tmp directory as well. I don't think I need to make any configuration changes in CGI for execution of the script. Does anyone has idea about the problem?</div>
<div style="RIGHT: auto"> </div>
<div style="RIGHT: auto">Here is my pytest.py and hello.map file. </div>
<div style="RIGHT: auto"> </div>
<div style="RIGHT: auto">#!/usr/bin/python<BR>import cgi<BR style="RIGHT: auto">import mapscript<BR>import random</div>
<div style="RIGHT: auto"><BR>image_name = "helloworld.png"</div>
<div style="RIGHT: auto">map = mapscript.mapObj (/home/public_html/map_server/pytest.map)<BR>img=map.draw()<BR>img.save("/home/public_html/map_server/tmp/" + image_name)</div>
<div style="RIGHT: auto">print "Content-type: text/html"<BR>print<BR>print "<html>"<BR>print "<header><title>Python Mapscript Test</title></header>"<BR>print "<body>"<BR>print """<BR><form name="hello" action="pytest.py" method="POST"><BR><input type="image" name="img" src="/tmp/%s"><BR></form><BR>""" % image_name<BR>print "</body>"<BR>print "</html>"</div>
<div style="RIGHT: auto"> </div>
<div style="RIGHT: auto">my hello.map is:</div>
<div style="RIGHT: auto"> </div>
<div style="RIGHT: auto">MAP<BR> NAME "hello_world"<BR> SIZE 400 300<BR> EXTENT -1.00 -1.00 1.00 1.00<BR> IMAGECOLOR 180 180 250<BR> IMAGETYPE PNG</div>
<div style="RIGHT: auto"> WEB<BR> TEMPLATE "/home/public_html/pytest.py"<BR> IMAGEPATH "/home/public_html/map_server/tmp/"<BR> IMAGEURL "/tmp/"<BR> END</div>
<div style="RIGHT: auto"> LAYER<BR> TYPE point<BR> STATUS DEFAULT<BR> FEATURE<BR> POINTS 0.0 0.0 END<BR> TEXT "Hello World"<BR> END</div>
<div style="RIGHT: auto"> CLASS<BR> STYLE<BR> COLOR 255 0 0<BR> END<BR> LABEL<BR> TYPE
bitmap<BR> END<BR> END<BR> END<BR>END<VAR id=yui-ie-cursor></VAR></div></div></body></html>