missing pydoc gui

J

JimG

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.
 
J

JimG

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.

I forgot to mention it's Python version 2.5.1.
 
B

Bernard Delmée

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...
 
J

JimG

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...

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.
 
B

Bernard Delmée

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.
 
J

JimG

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.

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.

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.
 
J

JimG

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.
On 26/12/2007 14:56, JimG wrote:

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.

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
be
the name of a function, module, package, or a dotted reference to
a
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
file.

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

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

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

Module docs for core modules are assumed to be in

http://www.python.org/doc/current/lib/

This can be overridden by setting the PYTHONDOCS environment
variable
to a different URL or to a local directory containing the Library
Reference Manual pages. .....
 
B

Bernard Delmée

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
Tkinter"

import pydoc
pydoc.gui()


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:
http://starship.python.net/crew/theller/pyhelp.cgi
which looks similar enough to what "pydoc -g" would offer.
 
B

Bernard Delmée

(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
pydoc.gui()

HTH,

Bernard.
 
J

JimG

(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
pydoc.gui()

HTH,

Bernard.

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....
 
T

TommW

JimG said:
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....


Jim:

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.

TomW
 
Joined
Jun 18, 2015
Messages
1
Reaction score
0
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
command:

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
self.age

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",
"http://docs.python.org/2/library")


##This can be overridden by setting the PYTHONDOCS environment
variable

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.

Regards,
Raj G
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,056
Messages
2,570,443
Members
47,089
Latest member
Bobby2025b

Latest Threads

Top