[python-win32] import and asp-python and iis - strange behaviour
simon.j.hook at jpl.nasa.gov
Tue Jun 7 06:14:08 CEST 2005
Looks like our messages crossed in the ether. Thanks for the
clarification. I was using
iis->click on default web site and start/stop, rather than restart iis.
Also thanks for info on python versus asp. In my previous message using
reload in a python file does work so you do not need to restart iis
everytime but it is probably inefficient?
Robert Brewer wrote:
>Simon Hook wrote:
>>I am trying to use import in an asp python page. If I have:
>><%@ LANGUAGE = Python%>
>>Then myfile can only be found if its in the root of the
>>python install directory, e.g. c:\python23
>>and only if the file is called myfile.py and it contains
>>python NOT asp code. If I have some python code and it is
>>loaded by a webpage, if I make any changes to the code
>>in myfile.py the changes do not come into effect unless
>>I reboot my machine. I tried start/stop/start iis but that
>>has no effect, I tried open/close/open and I tried the python
>>reload() command. None of these had any effect.
>>The only way I could get an asp-python file included was to
>>use the asp include:
>>How can I get asp to pull python code from another directory
>>and how can I make a change and not have to reboot for the
>>change to be invoked? Can I use import with an asp page?
>That's odd. When you say "stop/start iis" are you only restarting the
>www service? I find that the following works: open the Internet Services
>Manager, right click on the computer and choose "Restart IIS..." from
>the menu, then "Restart Internet Service on machinename".
>AFAICT, any code inside an .asp file will be reloaded whenever it
>changes. Any code within an imported .py file requires the restart I
>FWIW I've had some issues in the past with "import myfile", and I find
>"from mypackage import mfile" to be more reliable. Sorry; I don't have
>any hard data on that at the moment--lost in the mists of history. But
>everything I import in .asp files sits in my site-packages folder
>fumanchu at amor.org
More information about the Python-win32