namespace & imported modules

Peter Otten __peter__ at
Thu Nov 25 09:14:10 CET 2004

Jason wrote:

> def main():
>     # launch WatchDog timer thread
>     bcast_watchdog = hb_global.WatchDog(timeout=3)


> The last line in, hb_global.bcast_watchdog.reset(),
> is _supposed_ to call the WatchDog.reset() class instance method in

It seems you are creating bcast_watchdog as a local variable in
__main__.main(). How would you suppose it to become magically inserted in
the hb_global namespace? Do

def main():
    bcast_watchdog = hb_global.WatchDog(timeout=3)
    hb_global.bcast_watchdog = bcast_watchdog

to insert the WatchDog instance into the hb_global module. (Note that there
may be other problems as I didn't look any further)


More information about the Python-list mailing list