ASP and importing modules

kellyk at my-deja.com kellyk at my-deja.com
Wed Mar 8 17:21:27 EST 2000


> reload is an interactive convenience. If you're using it
> programmatically, you've designed something wrong.
>
> - Gordon

I posted the original message, sorry I was not clearer. Here is an
example of the way I'm using modules:

This is a module:
 ---------------------
 def main():
   return "yadda yadda yadda"
 ---------------------

This is an ASP script:
 ---------------------
 import module

 Request.Write(module.main())
 ---------------------

This does as expected and prints out "yadda yadda yadda"

Now if I change module.main in any way (for example to return
"blah blah blah") and refresh the page it still returns "yadda yadda
yadda". I can force the new version of the module to load by using
reload() in the ASP script but otherwise I will only ever get the
original module. Changes to the ASP script work as expected just not the
module.

If I want to make changes in a module and have them used this is what I
must do:

This is an ASP script that will reflect changes in the module:
 ---------------------
 import module

 reload(module)

 Request.Write(module.main())
 ---------------------


It seems a little odd to me but I thought it might be for performance
reasons.

thanks, Kelly


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list