473,378 Members | 1,175 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

using pydoc in an application

Hi all,

I'm discovering pydoc, and it seems to me that this is a great way to
have online documentation for my application. Are there any examples of
using this in some kind of help menu in an application? I've tried to
just bind pydoc.gui() to a menu item, but this just brings up the GUI
for pydoc, and the user still needs to search for the module before the
browser comes up, and when I quit serving pydoc.gui(), my application
dies along with it. Also, I need to get out of python to use pydoc.gui
again, or I get

error: (98, 'Address already in use')

I'm sure there's a better way to take advantage of this module and my
docstrings to get some online help. I'm using Tkinter and Pmw, but
maybe it's time to convert all this to wxWidgets?

Thanks for any help.

Jun 27 '06 #1
1 2162
I went and looked at the pydoc.py code, and it looks like it isn't
really meant to be used from inside another python program. After some
tinkering arond with my code, I ended up with this: (Google is messing
up my indentation)

(in my __init__ function)
....

menuBar.addmenuitem('Help', 'command', '',
command=self.run_pydoc,
label='Run pydoc (module
help GUI)')

....

def run_pydoc(self):
"""Run pydoc -g for gui based help"""
if 'linux' in sys.platform:
os.system('pydoc -g')
if 'win32' in sys.platform:
os.system(os.path.join(sys.prefix,
'Tools', 'Scripts',
'pydocgui.pyw'))
return

A bit of a kludge, but it works for me.

timw.google wrote:
Hi all,

I'm discovering pydoc, and it seems to me that this is a great way to
have online documentation for my application. Are there any examples of
using this in some kind of help menu in an application? I've tried to
just bind pydoc.gui() to a menu item, but this just brings up the GUI
for pydoc, and the user still needs to search for the module before the
browser comes up, and when I quit serving pydoc.gui(), my application
dies along with it. Also, I need to get out of python to use pydoc.gui
again, or I get

error: (98, 'Address already in use')

I'm sure there's a better way to take advantage of this module and my
docstrings to get some online help. I'm using Tkinter and Pmw, but
maybe it's time to convert all this to wxWidgets?

Thanks for any help.


Jun 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Greg Kuperberg | last post by:
I plan to use pydoc for my Python project. After looking through the standard documentation, I am not sure how pydoc interprets its input. In its basic operation it evidently looks at the first...
1
by: Colin J. Williams | last post by:
I am building a module which is based on the numarray package and its sub-packages. I am proposing to use PyDoc to document this module. The problem is that PyDoc generates links to...
0
by: Tony C | last post by:
According to the help for pydoc, it can be run as a script, from the command line. "Or, at the shell command line outside of Python: Run "pydoc <name>" to show documentation on something" ...
1
by: M.E.Farmer | last post by:
Hello again!, I just wanted to start off saying I love this newsgroup! Everytime I have an idea someone seems to post on it, or about it. The word for today is **Synchronicity** ! The reason for...
7
by: Brian van den Broek | last post by:
Hi all, I'm posting partly so my problem and solution might be more easily found by google, and partly out of mere curiosity. I've just spent a frustrating bit of time figuring out why pydoc...
3
by: Colin J. Williams | last post by:
Python advertises some basic service: C:\Python24>python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> With...
3
by: Rob Cowie | last post by:
I have searched this group and the wider net to find an answer to this, but I haven't been successful. Pydoc seems to be capable of writing documentation for all modules within a package by...
5
by: Wijaya Edward | last post by:
I tried to call pydoc from my Linux box. To my realization that it doesn't contain pydoc. I thought this module should be a default module. Can anybody suggest where can I find the module? I...
1
by: jmalone | last post by:
I have a python script that I need to freeze on AIX 5.1 (customer has AIX and does not want to install Python). The python script is pretty simple (the only things it imports are sys and socket)....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.