[Bf-python] Importing python code from textwindow as a module

Willian Padovani Germano wgermano at ig.com.br
Thu Jul 3 08:25:57 CEST 2003


(Replying to my own reply)

On Thu, 2003-07-03 at 02:09, Willian Padovani Germano wrote:
> On Wed, 2003-07-02 at 23:41, John Harris wrote:
> > I tried that out and it works great, just one last question. How can I 
> > make it unloade the modules even when the script crashes. Thanks again 
> > for the help, things will be a lot less annoying now.   asdf_46
(...)
> I don't know any better way to handle it.

Actually I do: put it at the start, not at the end:
---------------------
#before importing the Text module 'output':

import sys
if sys.modules.has_key('output'): del(sys.modules['output'])

# now import it

import output
...
---------------------

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list