Windows 7 - pydoc from cmd

Well, I have one of those points that makes me question my ability to use a computer. This is not a question that I imagined as my first SO post, but here it goes.

I started on Zed the new “Learn Python the Hard Way”, as I was looking for opportunities to return to programming after a 10-year hiatus, and python was always what I wanted. This book really spoke to me. That being said, I have a serious problem with pydoc from the command. I have all the directories in c: / python26 in my system path, and I can execute pydoc from the command line just fine, regardless of pwd, but it takes no arguments. No matter what I type, I just get the standard pydoc output telling me acceptable arguments.

Any ideas? For what it's worth, I installed ActivePython as suggested by Zed.

C:\Users\Chevee>pydoc file
pydoc - the Python documentation tool

pydoc.py <name> ...
    Show text documentation on something.  <name> may be the name of a
    Python keyword, topic, function, module, or package, or a dotted
    reference to a class or function within a module or module in a
    package.  If <name> contains a '\', it is used as the path to a
    Python source file to document. If name is 'keywords', 'topics',
    or 'modules', a listing of these things is displayed.

pydoc.py -k <keyword>
    Search for a keyword in the synopsis lines of all available modules.

pydoc.py -p <port>
    Start an HTTP server on the given port on the local machine.

pydoc.py -g
    Pop up a graphical interface for finding and serving documentation.

pydoc.py -w <name> ...
    Write out the HTML documentation for a module to a file in the current
    directory.  If <name> contains a '\', it is treated as a filename; if
    it names a directory, documentation is written for all the contents.


C:\Users\Chevee>

EDIT: new info, pydoc works fine in PowerShell. As a linux user, I have no idea why I am trying to use cmd anyway, but I would still like to find out what is with pydoc and cmd.

EDIT 2: additional information. In cmd ...

c:\>python c:/python26/lib/pydoc.py file

... works just fine. Everything works just fine with pydoc in PowerShell, without worrying about pwd, extensions or tracks.

+3
source share
5 answers

On Windows Powershell, use: python -m pydoc

Examples:

python -m pydoc open

python -m pydoc raw_input

python -m pydoc argv

+7
source

Windows, cmd Windows . , Inkscape .py python, cmd PATH. . .

+2

pydoc.py , "", .

0
python -m pydoc -k/p/g/w <name>
0

pydoc :

alt1:

C:\path\PythonXX\python.exe C:\path\PythonXX\Lib\pydoc.py -k/p/g/w X:\path\file_to_doc.py

alt2:

python -m pydoc -k/p/g/w X:\path\file_to_doc.py

, duh. Windows python "" .

Windows:

. , , - "" . "" "", , . , , , , . , , Python : X:\subfolders\PythonXX\ Path, :

X:\\\\-; X:\\PythonXX\

";" , . , , /, cmd.exe.

pydoc.py

, pydoc python lib, python. Windows, , , . pydoc.py :

windows cmd.exe:

X:\infolders\Python27\python.exe X:\subsfolders\Python27\Lib\pydoc.py

pydoc.py:

pydoc.py , : -k/p/g/w pydoc.py-.

:

- , x:\pathtofile\filename.suffix, . :

alt1:

X:\infolders\Python27\python.exe X:\subsfolders\Python27\Lib\pydoc.py -w X:\path\file_to_doc.py

alt2 ( python):

python -m pydoc -w X:\path\file_to_doc.py

"w" - HTML- , . , pydoc.py( ) . , , .

-m

From what I can find, -m seems to be processing registry entries, at least in msiexec.exe. I suggest that it can be used for programs in general in this way. Therefore, my speculative idea is that if "-m" is used, the paths of the chasing arguments will be rewritten so that the .exe file is used as a path reference. But, as said, rather speculative.

-m Replaces all required registry entries for the computer. (in msiexec.exe) According to Microsoft

0
source

Source: https://habr.com/ru/post/1774186/


All Articles