Yes, you need to do import myModule prior to invoking help on it. Detailed repro steps and identifying the python version are also essentials.
--- Bruce I'm hiring: http://www.cadencemd.com/info/jobs Latest blog post: Alice's Puzzle Page http://www.vroospeak.com Learn how hackers think: http://j.mp/gruyere-security On Thu, Aug 1, 2013 at 11:58 AM, David Goldsmith <[email protected]>wrote: > Hi, folks. First off, I've done "due diligence" searching the Python Refs > and Google, to no avail. I seem to have forgotten something fundamental > about using help with module-level docstrings: help('myModule') is raising > an "index out of range" exception. myModule.py is an argument-requiring > "script" (i.e., no "top level" def) that begins with a triple-quoted, > multi-line docstring. The only "clue" I have is that if I first try to > import the module, I get a "myVariable = sys.argv[1] IndexError: list > index out of range" exception, which is no surprise since, as I said, the > module requires at least one command line argument. Does help try to > import an object before attempting to spew its docstring? If so, is there > a "workaround" for my use-case as it stands, or do I have to "fix" my > script so that all arguments are optional? If that's not the problem, any > other ideas what it might be? Thanks in advance! > > OlyDLG > >
