Hi,
I am learning python CGI programming but got stuck with some issues. I would really appreciate if you could help me out.
Problem: I have made a web page using Python CGI scripts; from one of the menu items on the web page, I am trying to call another python cgi script which opens a pdf file. Following is the code:
In index.py
#!C:\Python25\python.exe
import cgi
import cgitb; cgitb.enable()
print "Content-type: text/html\n"
<html><head> <title>My page</title>
<link rel="stylesheet" href="C:\Program Files\Apache Software Foundation\Apache2.2\cgi-bin\mystyle.css"/></head>
<body><ul class="glossymenu"><li class="current">
<a href="resume.py"><b>Resume(.pdf 25kb)</b></a></li></ul></body></html>
In resume.py:
#!C:\Python25\python.exe
import cgi,os
import cgitb
cgitb.enable()
print "Content-type: text/html\n"
os.system('c:\resume.pdf')
When I execute http://localhost/cgi-bin/index.py the web page is displayed with 'resume' as the menu item.
When i click on menu 'resume' the script resume.py is executed but the pdf file is not opening. 'Done' is reflected on the bottom left corner of the browser & a white page is displayed.
I also noticed that when I click the 'resume' menu item at the same time a 'AcroRd32.exe' process starts in the system processes but no pdf file is displayed nor any error is thrown.
Further when I execute the script resume.py from the command line the pdf file opens up but not from browser.
Could you please throw some light on the issue?
Thanks & Regards