<div>Hi folks,</div>
<div> </div>
<div>I prepared a python script for dynamically get the absolute paths of the files in certain folder.</div>
<div>Then I tried to invoke that function from my web server in a .psp file like this:</div>
<div> </div>
<div> 1 <html><br> 2 <head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf8"></head><br> 3 <title>asdfasdfasdfa</title><br> 4 <body><br>
5 <%<br> 6 import glob<br> 7 import os<br> 8 <strong><font color="#ff0000">import Helper<br></font></strong> 9<br> 10 body = ''<br> 11 top = 'asdfasdfasdfa'<br> 12 links = {}<br>
13 <font color="#ff0000"><strong>Helper.GetLinks(top=top)<br></strong></font> 14 <strong><font color="#ff0000">paths = Helper.GenLinkPath(links)<br></font></strong> 15 body = paths<br> 16 %><br> 17 <%=body%><br>
18 </body><br> 19 </html><br> </div>
<div>However, this is the error message I received when I open the page in a browser:</div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Mod_python error: "PythonHandler mod_python.psp"<br><br>Traceback (most recent call last):<br><br>
File "/usr/lib/python2.5/site-packages/mod_python/apache.py", line 299, in HandlerDispatch<br> result = object(req)<br><br> File "/usr/lib/python2.5/site-packages/mod_python/psp.py", line 302, in handler<br>
p.run()<br><br> File "/usr/lib/python2.5/site-packages/mod_python/psp.py", line 213, in run<br> exec code in global_scope<br><br> File "/var/www/.cyu021/.pic/index.psp", line 8, in <br> import Helper<br>
<br>ImportError: No module named Helper</blockquote>
<div><br><strong><font color="#3333ff">PS. I put Helper.py and index.psp in the same dir<br></font></strong></div>
<div>Thanks in advance,<br>-- <br>This is a UTF-8 formatted mail<br>-----------------------------------------------<br>James C.-C.Yu</div>