Getting doc strings from in a module 
Author Message
 Getting doc strings from in a module

Maybe it's just because I haven't gotten coffee yet, but I can't
figure out how to do this.

I have a module that can be used as a script. I have a nice, long, doc
string at the start of the module. I'd like to be able to print out
that doc string if the user enters invalid args, or a "-help"
option. E.g.

if __name__ == "__main__":
  if len(sys.argv) == 0:
    print ???.__doc__

Is there any way to do this?

Heading out to the coffee shop,

Chris Hoffmann                          DataViews Corporation

GCS d H s+: g+ ?p a w v+ C+$ US+ P++(++++) L E+(+++) N++ K W--->-- M+
V- po- Y+ t+ 5+(+++) Jx R G tv b+++ D+ B-() e+++ u++ h---- f r+++ n--- y++++

Sun, 03 May 1998 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. __doc__ strings for C modules?

2. Doc string formatting module

3. Writing __doc__ strings for a C module?

4. doc string substition and overloading __doc__

5. Getting Ascii string from hex 'string'

6. Problem with string module and strings containing \0

7. string object methods vs string module functions

8. Fwd: gzip/zlib module Doc bug (1.5.2b2 Library Reference)

9. gzip/zlib module Doc bug (1.5.2b2 Library Reference)

10. Doc: Win vs. Unix linking dynamic load modules

11. calendar module doc?

12. little doc bug in Modules/readline.c


Powered by phpBB® Forum Software