Update:
After a reboot using code like this did work:
====
import os, sys, imp
if (sys.path.count(Server.MapPath('.')) == 0):
sys.path.append(Server.MapPath('.'))
import mymodule
====
But I am still looking for a better way to do this., that just seems ugly.
On Wednesday 13 June 2001 12:33 am, Robert Melton wrote:
> I have my own python module in:
> c:\inetpub\wwwroot\myapp\mymodule.py
>
> I have an asp file in the same directory:
> c:\inetpub\wwwroot\myapp\myaspfile.asp
>
> 'myaspfile.asp' imports mymodule at the top of the file, but can not find
> it. The reason it can't find it is because the directory the python script
> was run from is c:\winnt\system32(via the asp dll), and the module is not
> there, nor is the module in any of the other sys.path directories.
>
> This isn't horrible, because sys.path is a normal list, you can just append
> the current directory to the end, using something like this:
> sys.path.append(Server.MapPath('.')) #not lovely but works
>
> then in theory after you have the current directory in the sys.path, you
> should be able to 'import mymodule' just fine, but case and point I can
> not.
>
> Any advice/hints/other would be great, this is driving me up the wall.
>
> --Robert
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython