Search code examples
pythoncommand-promptitermpydoc

Why does "pydoc -g" at the command prompt bring up python libraries installed on my system, but I can't do that command from the Python Interpreter?


Why does typing:

  [user_name]$ pydoc -g

in iTerm (the command prompt) bring up the python index of modules on my computer, but I can't run that line from the Python Interpreter?

Thanks!


Solution

  • pydoc is a command line program /usr/bin/pydoc. In the Python Interpreter you can only access python classes and modules.

    If you want to do the same from the interpreter, you can import the pydoc module and then call pydoc.gui().