What are the existing open-source Python WxWidgets designers? - python

What are the usable tools?
I am aware of wxformbuilder and wxGlade, but none of them seems to be complete yet.

Here are a few of the most popular wxPython related GUI builders:
Boa Constructor (mostly dead)
wxGlade
wxFormBuilder
XRCed
wxDesigner (not FOSS)
Dabo - one of their videos shows a way to interactively design an app...
I personally just use a Python IDE to hand code my applications. My current favorite IDE is Wing.

I've been looking for them too and sadly I've come up empty handed. I used to like Boa Constructor and PythonCard back in the day but both projects seem to have stalled. There is an attempt to get PythonCard going again # http://trac.medianix.org/wiki/Pycard ; the site was down when I checked last but the mailing list seemed moderately active. Dabo's another actively-developed option.

afaik... none. I'll follow the answers to see if someone has one and try it of course but I'm not convinced this will be THAT useful. When using wxPython, you usually work with sizers (at least I think the results are better) so you don't really need to "place" the controls on the frame and I think a GUI "design" would be longer to do. The only part where I think it could have some interest is to fill atributes for the controls but a good auto-complete with wx (or a good cheat sheet or a "template class" with all the options you use) solves the problem in my opinion. I stopped seeking for a GUI designer for wx after trying Pydev that auto-completes wx very nicely (a lot better than everything I tried before... and that's a lot!).

Related

Looking for (wxPython) Python 2D drawing framework

I'm looking for a framework for drawing 2D scenes in Python. Not for game programming, but for 'office' like applications (e.g. drawing diagrams, mindmaps etc).
Preferable something that can be used with wxPython.
wxPython comes with OGL, but that is very old and no-one seems to use it any more (I couldn't find a reference to it in any recent project in sourceforge or google code).
The Qt (PyQt) framework has the Scenegraph thing, which I've used in some C++ projects, but I think PyQt with the Qt dependencies is too big.
Requirements are :
- managing objects
- hit-testing of objects
- ability to print the scenes
- modern look (at least anti-aliasing of lines)
I've been looking for some days now, but can't find anything that even comes close to PyQt's Scenegraph. I've been thinking about modifying OGL to use a wxGraphicsContext...
P.S. Anyone using OGL, please shout 'OGL is not dead' :-)
You might be able to use floatcanvas for this. Joran mentioned PyGame, which is certainly a legitimate option. I would also take a look at the WhyteBoard project (https://code.google.com/p/whyteboard/) which is written in wxPython and does a few of the items you mentioned. Finally, wxPython supports Cairo, which you also might find helpful. There are several demos of Cairo in the wxPython demo. By the way, wx.GraphicsContext (which you had mentioned) supports anti-aliasing, as does Cairo.

How can I have a Macro like recording feature for PyQt

I have a Qt tablewidget and other Qt widgets adjoining it. What I am looking for a Automatic script generator that records all the actions that I would perform on the table or other Qt widgets. I had also worked with Enthought and they have a wonderful apptool enthought.scripting that helps me with the same but only for traits objects. I would like to do the same on PyQt widgets but dont know how.
This is one of those ideas that seems so natural, it makes you wonder why there isn't already a library out there that does it.
Well, it turns out that writing something that gets you 80% of the solution is pretty straightforward, especially if your app is small. But implementing a recording/playback system that works for a large app with a diverse array of widgets is quite a pain.
I wrote a library that does its best to solve this problem. It's full of hacks, and the code is still very immature (I just pushed the repo to github today), but you might get some ideas. Heck, if you're lucky, you might even be able to use it without any changes:
https://github.com/stuarteberg/eventcapture
There's no documentation yet. I plan to explain all the tricks to get this working, and probably clean up the code a bit. For now, you can at least get started by trying the demo as described in the Readme.
You could use the eventFilter method from your QApplication instance.

Framework for paint program

I've decided to start working on a personal project, attempting to develop a cross platform, MSPaint like app. Oddly enough, I find mspaint is one of the applications I miss the most on Linux or OS X, so I want to try to make something similar. Tuxpaint, mtpaint, gpaint, etc. are all old and inactive and ugly. I don't want to make GIMP, just the basics, similar in features to MS Paint.
I'm thinking of doing it in python with the pygtk toolkit, but I was interested to hear your suggestions. Would C/C++ be a better choice, or even C# (gasp!) with mono? How about using Qt as opposed to GTK, or maybe some other fancy library I don't know about (Please, not FLTK!). I'd be curious to hear your thoughts.
Thanks!
Qt's canvas object (or its newer replacement QGraphicsView) can do pretty cool things. Whether you choose C++ or python is a matter of personal choice, as Qt is supported in both languages. For a simple project like this I'd choose python because killer performance is not much of an issue, and it will be much easier to write.
Another thing to look into is making this app web based with HTML5's canvas object and Javascript. It can be surprisingly robust, and anything that can be put on the cloud is a win in most cases.
If you decide to go with Python (which would be my choice because it's such a simple language), then TkInter is considered the de-facto standard GUI package. That link should send you to some excellent starting references for TkInter, although I also really like Not_a_Golfer's suggestion of an HTML5 web-app.
Short: You can use both, no third party library is guaranteed to be distributed with all major distributions.
Long:
Gtk+ vs. Qt
What do you want incorporate into your application. If it is just selecting a brush, selecting color you could pretty much use any gui toolkit.
If you are going to run it as a web-based tool, Gtk+ has an html5 backend renderer (I don't know about Qt)
A sidenote:
I recommend to use the toolkit's native programming language (gtk+ C, Qt C++) - if you don't, you will suffer from delays with bugfixes, generally more bugs and delayed releases, though for that case it shouldn't really matter.
Everything else boils down to personal preferences and there already exist some questions to tackling that issue.
if you are using qt,you can use QtitanRibbon

Python Web/UI Options

We are in the process of standing up a UI on top of a python system. This is all throw away code, so we want something quick, yet presentable.
We will have a couple of "interfaces" but they will be of two types. One will be control, it will basically be sitting on top of a python thread, and accepting requests from the user.
The other will be more of a display screen that will need to be able to display images, and some classic "grid views" of text to the user.
We pretty much know we could* do all of this in HTML but wasn't sure what would be the best way to interact with the core python code?
Anyone know of a good UI python presentation layer? Since we know we can do all of this in HTML/Jquery pretty quickly, we are also open to suggestions on how to integrate this with a web server..
Any suggestions? Really interested in finding out if there is any way to use python as the back end to a webserver.
Let me know if you all need more information.
I like wxPython. The demo application is excellent and lets you browse, tweak and re-run the code right in the demo.
We have found the DJango meets our needs. It is a pretty slick mvc style python web stack. Really is easy to use, and very quick to develop in. I will say that the ORM layer is a little young so it is hard to do some simple queries, but luckly since this is throw away code we can just use native sql.
Tkinter is probably going to be the solution you can use quickest. Its API is simple and straight-forward, and you probably already have it installed.
As the other 2 classic Python GUI options have been given already, I feel duty bound to suggest PyQt :)
Using QT Designer I've found it much simpler than TKInter to get some basic GUIs up and running. Build your GUI up in a WYSIWYG way, then hook it up to the back-end logic. I've also found that the large amount of C++ help on QT available on the interent usually translates more or less directly across to PyQt. The resources available for TKInter are IMO pretty obtuse, and simply stop as soon as you want to do anything more interesting than Hello World. YMMV.
The Rapid GUI Programming with Python and QT book is a fantastic resource. Had me programming real applications in no time.

Is there a Python library that allows to build user interfaces without writing much code?

I am writing editing front ends in Python since several years now, and I am fed up with micromanaging every UI detail of a window or dialog every single time.
Is there a technology that allows me to, say, specify the relations between a GTK+ Glade-designed interface and the tables and records of an SQLite database to do all the middle man work? It should spare me the work of manually writing event handlers, input evaluators and view updates.
The technologies in question are just examples, but I want to stick with Python as far as possible.
Besides the ones already mentioned I can add:
Kiwi
uxpython
pygtk
treethon
I've never used any of them so have no recommendations but, for what it's worth, I have used at least 2 complex programs built directly on pygtk that worked in both Windows and Linux.
I think Kiwi is the only one of these with baked in support for db (through interface with SQLAlchemy, SQLObject, or Storm) but I would be surprised if you couldn't use one of those ORM's inside any of the other frameworks.
PyQt and its models can automate some of these tasks for you (to some amount off course, e.g. filling widgets with data from a database and handling most of the widgets behaviour, buffering etc.).
If you want a more object-oriented approach to handling SQL you could look into an ORM-oriented solution (for example SQLAlchemy).
Dabo is built on top of wxPython, so you may not prefer it, but it's designed to make it easy to tie a GUI to a database, so I'd recommend you check it out if you haven't already. In particular, it's got good facilities for tying widgets to data, and handling a lot of the common cases of GUI development.
wxGlade may help, although I haven't used it myself so I don't speak from experience.
Boa Constructor apparently has a wxPython GUI builder in it, and there is also PythonCard, though development on these two projects seems to have stalled.
Traits might be a good option for you.
http://code.enthought.com/projects/traits/docs/html/TUIUG/index.html
AS simple as it is to map a UI to an object, it doesn't seem too far fetched to incorporate SQLAlchemy for persistence.
There is a good book on wxPython, "wxPython in Action", which can't be said for some of the other solutions. No knock on the others. I've had success developing with wxPython in the past and it comes with a great set of demo applications with source code from which you can borrow liberally.
The best UI designer I found for wxPython applications is a commercial one, Anthemion DialogBlocks. It's by one of the wxPython programmers and is worth the money. Other solutions for UI design include wxGlade (I found it usable but not featureful) and Boa Constructor (haven't used it). Wing IDE might also have one. Stani's Python Editor bundles wxGlade, I believe. There are a lot of other projects that don't really work or are fairly old.
As far as SQL automation goes, as another answerer says, I'd look at SQL alchemy, but the learning curve for a small application might be too much and you'd be better off just going straight to odbc. The best odbc api is the one used by Django, pyodbc.
It's been a while since I developed with these tools, so there may be something newer for each, but at the time these were definitely the best of breed in my opinion.
I had lots of success with wxPython, but that was some years ago now and there may be better new solutions...
Ok this is an unconventional solution but write yourself a code generator. I have done this several times using Mako. So in my case I auto inspect a table which columns it contains and types and generate classes from that. It's more work upfront but does exactly what you want and is reusable in subsequent projects.

Categories

Resources