Re[2]: [python-win32] New python user - first question

Jim Abrams Jim Abrams <jabrams@publishingresources.com>
Mon, 13 Aug 2001 16:02:44 -0400


You'll need to explicitly reload the module.
reload(module)
What seems to be a popular way of doing it is to put all the reload
statements into 1 file and run that file when you want to refresh all
your custom modules.

Restarting your web service will do it as well.

-- 
Jim Abrams

RA> Yup. That was the problem. I knew it was relatively easy.

RA> Now, the problem I'm having is that I changed foo.py, but ASP doesn't
RA> recognize the change. It still assumes that the file has the same functions
RA> in it. How do I 'flush the cache' so to speak?

RA> R

RA> ----- Original Message -----
RA> From: "Jim Abrams" <jabrams@publishingresources.com>
RA> To: "Robb Allen" <myself@robballen.com>
RA> Cc: <Python-win32@python.org>
RA> Sent: Monday, August 13, 2001 3:08 PM
RA> Subject: Re: [python-win32] New python user - first question


>>
>>
>> No poking fun here, one time I spent 2 days trying to uncover very
>> strange bugs in my test.py module.
>>
>> Then someone let me onto the hint that python has a built in module named
RA> test.
>> As soon as I renamed my module to something else all worked fine.
>>
>> --
>> Jim Abrams
>>
>> RA> I'm new to Python. Been running with it for a whopping 4 days. I come
RA> from a
>> RA> background using VBScript and Java and have found Python to
RA> potentially
>> RA> solve some problems I've encountered.
>>
>> RA> Just trying to get a basic web page up through IIS and am having a
RA> what I am
>> RA> sure to be a newbie issue, but it's the one thing I can't seem to fix.
RA> I
>> RA> have a page on a web site called "test.py". test.py looks like this
>>
>> RA> def foo(a):
>> RA>     return a
>>
>> RA> Then, the asp page looks like this
>>
>> RA> <%@ LANGUAGE = Python %>
>>
>> RA> <%
>> RA> import test
>>
>> RA> test.foo('hello')
>>
>> %>>
>>
>> RA> When I run it, I get "AttributeError: 'test' module has no attribute
RA> 'foo'"
>>
>> RA> Reeeeal simple, but I'm missing something. Anyone care to poke fun at
RA> the
>> RA> newbie?
>>
>> RA> R
>>
>>
>> RA> _______________________________________________
>> RA> Python-win32 mailing list
>> RA> Python-win32@python.org
>> RA> http://mail.python.org/mailman/listinfo/python-win32


RA> _______________________________________________
RA> Python-win32 mailing list
RA> Python-win32@python.org
RA> http://mail.python.org/mailman/listinfo/python-win32