Hello All,
I am developing a GUI application in wxPython on linux.
I have to provide help menu describing tool's usage.
I am not able to get any modules realated to this.Can anybody know how to develope help in wxPython?
Thx,
rajashree
Hello All,
I am developing a GUI application in wxPython on linux.
I have to provide help menu describing tool's usage.
I am not able to get any modules realated to this.Can anybody know how to develope help in wxPython?
Thx,
rajashree
This thread centers on adding user-facing help to a wxPython GUI on Linux. already pointed toward HTML-based help and asked for a CHM-like experience. Below are practical, portable options and short, ready-to-use examples that build on those ideas while keeping distribution and cross-platform behavior in mind.
A robust workflow is to write docs as plain reStructuredText or Markdown, generate static HTML (Sphinx or any static-site tool), and ship the generated files with the application. Serving local HTML keeps formatting and search intact and avoids platform-specific help formats. To open the installed help in the system browser:
import os, webbrowser
def open_help():
base = os.path.dirname(__file__)
index = os.path.join(base, "docs", "index.html")
webbrowser.open("file://" + os.path.abspath(index)) For an embedded, in-app display (more "native" feel), use a WebView control when available. The following example creates a simple help window that loads a local index.html:
import wx, wx.html2 as webview
import os
class HelpFrame(wx.Frame):
def __init__(self, parent):
super().__init__(parent, title="Help", size=(800,600))
browser = webview.WebView.New(self)
path = os.path.abspath(os.path.join(os.path.dirname(__file__),"docs","index.html"))
browser.LoadURL("file://" + path) Notes and packaging tips: CHM is Windows-only; prefer HTML or PDF for Linux. When bundling, include the docs folder as data (PyInstaller/packaging tools) and resolve paths at runtime with importlib.resources or pkg_resources so the help works from an installed package or a single-file build. Quick troubleshooting: always use absolute paths, test with spaces and special characters in filenames, and verify that the HTML assets (CSS, JS) are present relative to index.html.
Jump to Post— vegaseat 1,735Python allows you to add documentation strings to a class, module or method and access it later ...
# a look at the Python documentation string # you can just use single quotes for a one liner import math def getDistance(x1, y1, x2, y2): """ getDistance(x1, y1, …
Jump to Post— vegaseat 1,735Now I understand what you want to do. You can insert a help menu item that brings up a .chm or .html file. There are a number of Python programs that do it that way.
Python allows you to add documentation strings to a class, module or method and access it later ...
# a look at the Python documentation string
# you can just use single quotes for a one liner
import math
def getDistance(x1, y1, x2, y2):
"""
getDistance(x1, y1, x2, y2)
returns distance between two points using the pythagorean theorem
the function parameters are the coordinates of the two points
"""
dx = x2 - x1
dy = y2 - y1
return math.sqrt(dx**2 + dy**2)
print "Distance between point(1,3) and point(4,7) is", getDistance(1,3,4,7)
print '-'*50
print "The function's documentation string:"
# shows comment between the triple quotes, use double underline each side
print getDistance.__doc__ With wxPython you can use a button marked help that brings up a dialog window containing help text.
thx but this is not wht i m looking for.
It's to give help to understand the code! I m in need of Help creation which will guide user how to use the application.
for e.g. in .Net we can do it by developing .chm files.
Now I understand what you want to do. You can insert a help menu item that brings up a .chm or .html file. There are a number of Python programs that do it that way.
yes....and i m looking for those ways!!!!
do u have any idea how it is done? which wxPython modules can be used do that?
Hey Thanks a lot :)!!!
I think this will help me!
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.