I'm building a Gtk3 application using Python. I was wondering if there was a standard way for building and displaying inline help (the manual). More specifically:
What text format should I use for storing it (html? XML? other?)
How should I display it? I need to be able to browse the contents, the search for specific terms, to display formatted text with images, and to open the help window at a specific location when the user request online help about a specific part of the user interface.
Finally, in the ideal case, it should be cross-platform (e.g. I plan to port it to Windows)
Didn't know your app needed to be multiplatform. Be careful, because GTK3 on Windows is quite difficult to use for the time being (AFAIK there are no official installer either for GTK3 nor PyGObject on Windows, only community stuff).
On Linux, GNOME uses Yelp to handle documentation, but I don't know if it has been ported to Windows.
Related
I'm trying to capture my screen using Python because I'll use it on OpenCV, but I couldn't find a way to make it work on Gnome, since Gnome uses Wayland and all libraries that I've found only work with X11.
For now I'm not considering change my interface. I'm searching a solution to this problem.
Does someone know a solution?
To be more specific, I'll use the images to train an AI and so I need they continuously.
EDIT:
I've found this but how can I pass frames to OpenCV in Python instead of save a video file?
The proper way to do screencasting these days is by using the Screencast portal, which is part of XDG desktop portals and is already supported by GNOME, KDE, wlroots (and more). As an added advantage, this will also work in containerized formats like Flatpaks.
You can find an example on how to do screencasting in Pyhon using this snippet, created by one of the Mutter maintainers. If you look for parse_launch(), you will see a GStreamer pipeline which you can modify to include the GStreamer OpenCV elements that can do the processing for you.
Note: in your edit, you link to a predecessor of that portal, which is GNOME-specifc, internal API, so I wouldn't rely on it ;-)
Hello I am planning on creating a program in Python 2.7 using a tkinter GUI. I am looking for some guidance on the best method to play text as audio in order to aid people with visual difficulties.
The text that will need to be played would be text on buttons and text within textboxes. are there any libraries I can import that can help me achieve this?
Thanks.
The answer appears to be 'no'. According to tcl/tk developer Kevin Walzer "Tk doesn't support [screen readers]. I've looked into it a bit and it seems like a huge project to implement on a cross-platform basis." See link for a bit more.
If you really want to develop an accessible GUI application in Python, you shouldn't use Tkinter since it is not accessible at all.
Consider using some framework that has bindings to native APIs/controls, for example, WxPython which is a Python port of WxWidgets.
I have a python application using PySide, Qt and python. In my application I would like to open and display a pdf document, but have the viewer within the application and not using the default viewer on the operating system.
I have not as of yet been able to find a widget which is capable of doing this or some example code. I have never used these tools before and this is my first Qt & PySide application so I am sure there is a widget which is capable of this but that I am just not aware of it.
I found this post and when I take the sample code I am unable to get any pdf to show and cannot replicate the behaviour of the poster, but I am using python 2.7.3, PySide 1.1.1 so perhaps this is why. The error that I get when trying to run the sample code in the other post is:
QWebInspector: QSettings couldn't read configuration setting [resourceTrackingEnabled].
and the pdfs I would like to render are saved locally, in the same directory as the the python script and not accessible via the web.
Could somebody point me in the direction of some sample code or a Qt widget which I would be able to use to render a pdf?
As an aside, I am not sure that it matters but the pdf will be generated using LaTeX.
Edit --More information--
The program has to run on both Windows and Mac OSX environments but it is just for a personal project which wont be distributed. Using PyQt is not an option as it is not compatible with the python editor that I use and PySide is the requirement. I have read the following link but from what I understood under the Rendering section it said that the 3rd party libraries available worked with C, C++ and Qt not python or PySide but maybe I have misunderstood this?
CLI applications like Vim, cdargs can open a new screen then allow users to draw characters there. I'd like to try making some tools like that with Node and was told that it was called "alternative screen"(?).
I'm familiar with JS. But if there's not a solution, Python maybe(..) OK. Want some code example please :)
Found a modules according to tMC's anwser, trying to figure out...
https://github.com/mscdex/node-ncurses
Vim uses the ncurses library to do drawing. You have already found a Node.JS bindings, so you should have no trouble using this library within your application.
I propose you to read the NCURSES tutorial and attempt to do it in Node.JS.
Im new to python and want to create a GUI front-end (desktop, rather than web) for my python script. The script essentially parses XML files and runs various searches over the contents (eg. accepts regex searches from the user, returns results etc).
It works well on the command line but I want to present a more user friendly interface.
There seems to be a lot of options out there - http://docs.python.org/faq/gui.html
Or should I look elsewhere?
Can someone recommend a GUI toolkit for Python?
Cheers.
I recommend using one of Tkinter, wxPython or PyQt. They are all equally suitable for a simple task. My personal favorite is Tkinter because I think it is the simplest way to get started. However, any of those would make a fine choice.
Here is a page on the Python wiki with some fifty options.
PyQt is great, although it's on GPL. There is also PySide alternative on LGPL.
You can also try wxPython or PyGTK if you don't like Qt for some reason. There is also gui library in python standard library called Tkinter, but I haven't used it and don't have any experience with it.