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[91m{}\033[0m".format(message))
    if exit >= 0:
        sys.exit(exit)

I import this module into another module, with the doc string I want
to display.  However, calling usage prints toolkit's doc string
(None), not the current module's doc string.

How can I access the top level module's doc string from toolkit?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to