missing pydoc gui

Discussion in 'Python' started by JimG, Dec 24, 2007.

  1. JimG

    JimG Guest

    I just read about the pydoc gui in "Learning Python." But it's
    mysteriously absent from my Fedora 8 Python installation. Searching
    the filesystem exhaustively turns up no pydocgui script anywhere, and
    not only does "pydoc -g" not work, my Python documentation has no
    mention of it, it describes pydoc -p (and that works fine) but not
    pydoc -g.

    My theory is I'm missing some package that contains it. However I've
    been completely stymied in my efforts to identify one. I already have
    python-tools, python-docs, python-docutils, and python-devel, among
    others. Any help would be greatly appreciated, thanks.
    JimG, Dec 24, 2007
    1. Advertisements

  2. JimG

    JimG Guest

    I forgot to mention it's Python version 2.5.1.
    JimG, Dec 24, 2007
    1. Advertisements

  3. Hi Jim, I guess you're missing tk and its tkinter
    python wrapper. Sorry I don't know what the corresponding
    packages would be called under fedora...
    Bernard Delmée, Dec 26, 2007
  4. JimG

    JimG Guest

    Hi Bernard,

    Thanks for the suggestion, however, that does not seem to be the
    reason since I already have both tk and tkinter. I tried adding tk-
    devel but that made no difference.
    JimG, Dec 26, 2007
  5. FWIW I am using 2.4.4 under debian etch and 2.5.1 under windows XP,
    and pydoc seems to support the -[pgkw] flags under both versions.
    When trying -g under debian, I am getting a stack-trace and a message
    inviting me to install the python-tk package.

    Does "pydoc -g" provide any feedback on your installation?

    One nice alternative for python standard doc is the .CHM file
    provided at python.org. You can use the "xchm" viewer under linux.
    Bernard Delmée, Dec 26, 2007
  6. JimG

    JimG Guest

    That's the weird part. The man page for pydoc doesn't mention -g as a
    supported option and the output of pydoc -g just prints out the usage/
    options information -- -k, -p, -w are the options. As if the version
    of pydoc I have is built without gui support.
    JimG, Dec 26, 2007
  7. JimG

    JimG Guest

    Uh, not the man page... the output of "pydoc pydoc." Here's a snip:

    Or, at the shell command line outside of Python:

    Run "pydoc <name>" to show documentation on something. <name> may
    the name of a function, module, package, or a dotted reference to
    class or function within a module or module in a package. If the
    argument contains a path segment delimiter (e.g. slash on Unix,
    backslash on Windows) it is treated as the path to a Python source

    Run "pydoc -k <keyword>" to search for a keyword in the synopsis
    of all available modules.

    Run "pydoc -p <port>" to start an HTTP server on a given port on
    local machine to generate documentation web pages.

    Run "pydoc -w <name>" to write out the HTML documentation for a
    to a file named "<name>.html".

    Module docs for core modules are assumed to be in


    This can be overridden by setting the PYTHONDOCS environment
    to a different URL or to a local directory containing the Library
    Reference Manual pages. .....
    JimG, Dec 26, 2007
  8. I see what you mean, having started my fedora8-live image under
    virtualbox. -g support is apparently not there with this
    distribution, oddly enough. Perhaps you should post your
    question on a fedora support forum.

    Under the live cd (hence probably with a smaller selection of
    available packages than you have), if I try the following
    at the interactive python prompt, I am getting "No module named

    import pydoc

    You probably discovered this already, but you can at least
    launch "pydoc -p 1234" and view the python doc by pointing
    your browser to localhost:1234. The small tkinter gui normally
    invoked by "-g" would add a handy search box to this viewer...

    The main python doc page points to the following search link:
    which looks similar enough to what "pydoc -g" would offer.
    Bernard Delmée, Dec 26, 2007
  9. (I know replying to self is a sure sign of aging :)
    A quick update: after installing the 'tkinter' fedora
    package (still in live-cd mode), the following 3 lines
    script does what "pydoc -g " should:

    import Tkinter
    import pydoc


    Bernard Delmée, Dec 26, 2007
  10. JimG

    JimG Guest

    Brilliant! That's an easy solution to my problem. I'll try posting
    to one of the Fedora forums to see if anyone there knows why. I
    appreciate your help with this. I love Linux but every now and then
    you run into one of its annoying little oddities....
    JimG, Dec 26, 2007
  11. JimG

    TommW Guest


    I have a copy of Fedora 8 in a VMachine. I found that I could get the
    Pydoc Server to start by doing the following. I also found that I had
    to install tkinter first. I then modified a copy of "pydoc" in usr/bin
    as follows:

    #!/usr/bin env python2.5

    import pydoc
    if __name__ == '__main__':
    pydoc.gui() # Was pydoc.cli() in the original "pydoc"

    I then named it "pydocgui", saved it to the desktop for now, then set it
    to open with Python in its document properties.

    If I double click on this file, then select run from the dialog, the
    Pydoc Server opens.

    TommW, Dec 27, 2007
  12. JimG


    Jun 18, 2015
    Likes Received:
    Hi All,

    Not sure whether this is the right place to ask this. PyDoc , as stated, will link to "<standard library URL>" for built-in modules when it runs through the code which has standard modules imported.
    However, when i am trying it, its linking the standard modules also to a local file assuming that the file is residing in the base directory of the code file.
    e.g. code:
    This example module shows various types of documentation available for use
    with pydoc. To generate HTML documentation for this module issue the

    pydoc -w foosball

    import os
    import datetime
    print str(datetime.datetime.now())
    class Fooseball(object):
    Fooseball encapsulates a name and an age.
    def __init__(self, name, age):
    Construct a new 'Fooseball' object.
    self.name = name

    def barmyself(bazaar):
    Prints baz to the display.
    print bazaar

    if __name__ == '__main__':
    f = Fooseball('John Doe', 42)
    barmyself("hello world")


    so, for OS and DateTime modules, i get a link the generated html pointing to local directory instead of

    Module docs for core modules are assumed to be in

    docloc = os.environ.get("PYTHONDOCS",

    ##This can be overridden by setting the PYTHONDOCS environment

    how to get this right? I have wasted editing the pydoc.py itself to get it right, no go. the Module Docs will set the file link wrongly at the top left corner of the page, but does not help in linking the standard modules.

    any help is appreciated.

    Raj G
    RajashekharaG, Jun 18, 2015
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.