Module access from inside itself

Aahz aahz at pythoncraft.com
Fri Aug 15 22:31:05 EDT 2003


In article <pan.2003.08.16.02.34.37.555746.14368 at mikka.net.au>,
Steven  <dippy at mikka.net.au> wrote:
>
>if __name__ == "__main__":
>    opts, args = getop.getopt(sys.argv[1:], [], ["help"])
>    for opt in opts:
>        if opt == "--help":
>            print MY_MODULE.__doc__    # How do I get this?
>        else:
>            MyFunction(args)

import __main__
print __main__.__doc__
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

This is Python.  We don't care much about theory, except where it intersects 
with useful practice.  --Aahz




More information about the Python-list mailing list