From: David G. <d.l...@gm...> - 2013-08-02 21:19:48
|
Hi! I: am running Python 2.7.3 and py2exe 0.6.9 in 64-bit Windows 7; did "due diligence" before posting this; and know that Python's built-in help "is intended for interactive use." Nevertheless, using the code: if len(sys.argv)-1: if sys.argv[1].lower()=='help': help('myapp') return I have my application successfully using Python's builtin help such that if I type at a DOS prompt: python myapp.py "help" it replies the same as if I typed help('myapp') in the Python interpreter. Also, my app builds and runs fine using py2exe...except this help functionality: myapp.exe "help" returns "NameError: name 'help' undefined". I tracked this down to py2exe not importing "site.py" (the automatically imported module that imports a wrapped version of pydoc.help) which I can understand, since its name implies that it probably imports deployment-specific data. Nevertheless, I tried various ways to "work around" this "limitation," all unsuccessful, so I've decided to post here: is there some way to include for py2exe either site.py or, preferably (since site.py appears to import many, many other things I don't need) pydoc, or even just pydoc.help, such that myapp.exe "help" will work the same as python myapp.py "help"? Thanks! OlyDLG |