I think this will work...
----
from ftplib import *
...
# reload code below
import ftplib
reload(ftplib)
from ftplib import *
----
That should update all the stuff that was imported by ftplib the first
time. But you'll have to call it in global space in order to update
global space.
I vaguely remember doing it before, that's how sure I am it'll work. If
you want to have a method that update's the global namespace do this...
def update():
g = globals()
import ftplib
reload(ftplib)
for key, val in ftplib.__dict__:
g[key] = val
I haven't tried that though, it's just a guess :)
GBU
Matthew
Jeff Shannon wrote:
>John Mark Agosta wrote:
>
>
>
>>During interactive development one can reload modules that have been
>>imported and modified by doing a reload(module_name). How does this work
>>if the module was imported into the main module with the "from ... import
>>*" form? Is there a way to reload() them?
>>
>>
>
>Not really. The problem is that you have no handle to the module itself, since
>you've thrown that away during the import process, so there's no good way to
>connect those names back to the module they came from. This is yet another
>reason why that form is usually better avoided, especially with modules that are
>still under development.
>
>Jeff Shannon
>Technician/Programmer
>Credit International
>
>
>_______________________________________________
>ActivePython mailing list
>[EMAIL PROTECTED]
>To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython
>
>
>
>
>
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython