Re: Get __doc__ from main module in imported module.

2010-02-10 Thread David
> > How can I access the top level module's doc string from toolkit? > > Like > >      import __main__ >      print_usage( __main__ ) > > with suitable definition of 'usage'. > > Cheers & hth., > > - Alf Problem solved! Thanks for the other tips too. -- http://mail.python.org/mailman/listinfo/pyt

Re: Get __doc__ from main module in imported module.

2010-02-10 Thread Alf P. Steinbach
* David: I have a module toolkit.py with some functions I use often. One of these functions displays a usage message (__doc__). def usage(messages=[], exit=-1): """Print the doc string as wells as any useful messages.""" print(__doc__) for message in messages: print("\033[91