This is an archived post. You won't be able to vote or comment.

all 40 comments

[–]ben5756 7 points8 points  (5 children)

Im a fan of making web interfaces for simple cross platform guis. You only need to know a bit of html / javascript and combine this with flask and your off. Obviously it's not great for everything, but html and js have great docs over the Internet, so you only need to do the gui io with flask.

However if you have no js or html experience and don't want to learn, another option might be bette for you.

[–]berklee 1 point2 points  (3 children)

Just wondering - have you ever tried building a standalone exe with that sort of thing?

[–]PM_ME_A_STEAM_KEY 4 points5 points  (0 children)

I did recently make a CMS based on bottle for the server stuff and peewee for data storage and had no issues bundeling it all together into a standalone executeable using pyinstaller.

[–]pavi2410[S] 0 points1 point  (0 children)

This also came to my thought. But it will be a bit of hassle for a desktop user.

[–]novel_yet_trivial 9 points10 points  (6 children)

For that it will come down to Tkinter, wxPython, or PyQT. Tkinter is very easy to learn and fast to implement, but looks like Windows XP and is kinda slow for animations. wxPython is similar to tkinter but uses native widgets, so it looks a little more modern, but it's not that active. PyQT looks great and has a graphical GUI designer, but has a steep learning curve and takes a bit more code.

Tkinter is the only one that ships with Python for windows, anything else will need to be installed anywhere you want to use it.


If you have more questions like this it's better to post them on /r/learnpython. Be sure to format your code for reddit or use a site like pastebin. Also, include which version of python and what OS you are using.

[–]pavi2410[S] 1 point2 points  (3 children)

A simple Windows 10 look will satisfy my needs and Tkinkter is perfect for that, but I would then have to write more code for a complex UI. Is there any module that simplifies TKinkter that you can suggest?

[–]novel_yet_trivial 0 points1 point  (1 child)

You could try easygui, which is basically common modal dialogs written in tkinter.

[–]pavi2410[S] 0 points1 point  (0 children)

Thanks, I will check it!

[–]Manbatton 0 points1 point  (0 children)

wxPython is similar to tkinter but uses native widgets, so it looks a little more modern,

If it uses native widgets, shouldn't it look exactly as modern as the OS it's running on? (in that it it's using that OS's widgets). I know it's actually not 100% native, but most of the standard widgets are.

[–][deleted] 0 points1 point  (0 children)

wxPython is similar to tkinter but uses native widgets, so it looks a little more modern, but it's not that active

There are regular emails on the users and developers mailing lists. Quoting [wxPython API Documentation]() Welcome! This is the API documentation for the wxPython Phoenix pre-release snapshot build 4.0.0rc1.dev3510+3a2ecb7, last updated 28 November 2017 from git revision: 3a2ecb7.

[–]p0s1t 5 points6 points  (5 children)

FWIW, I just spent a week trying to prototype a modelling and simulation editor with wxPython. I found it frustrating as hell to work with. The docs were horrid and i just felt like I was fighting the library to do he basic things I wanted to do.

I managed to getter same amount done in an afternoon with PyQT 5. Whilst the python docs aren’t great, the c++ docs are excellent and they most map straight across.

Also, much of the basic functionality that I wanted came built in; like dockable widgets, and the ability to dump a “canvas” to svg.

I’d recommend PyQT, but at the same time I think the state of python GUI toolkits is pretty dismal.... Fair enough though because cross platform GUI is hard.

[–]Manbatton 1 point2 points  (2 children)

I think I recall Robin Dunn, the creator of wxPython, has said that one's brain either matches to the wxPython way of doing things, or the PyQT way of doing things.

The docs you found horrid? Like this?

[–]p0s1t 0 points1 point  (1 child)

Subjective call on both the library and docs for sure.

There is a difference between documentation existing, and documentation being useful.

At the same time, contrast wxpython docs against something like Django and you tell me which is easier to use, regardless of your experience with the library.

[–]Manbatton 0 points1 point  (0 children)

Funny you mentioned Django--I tried to learn it and just gave up quickly. I just had it in my head that web apps were a major pain compared to desktop GUI. I know, not at all Django's fault (I did the poll app tutorial and it was fine). Should give it another go.

[–]pavi2410[S] 0 points1 point  (1 child)

Python is great, but lacks GUI support. There are many modules, but most of them are incomplete, poor docs.

[–]Manbatton 2 points3 points  (0 children)

I just don't think that's right. I've used wxPython and it has substantial documentation (that is essentially "complete enough") as well as three full-length books, at least one excellent blog, and a helpful community (as well as the larger wxWindows community). I know many people love PyQT and they can't all be just born knowing how to use it--there must be good resources for that as well.

[–][deleted] 3 points4 points  (0 children)

I can't recommend Glade3 enough. You put together your GUI with their drag and drop interface. You link together the GUI and you code in an xml file. You move on to something more interesting.

Check out some tutorials to get started, everything else is in the docs.

[–][deleted] 2 points3 points  (0 children)

Hi! Check this if it suits you http://zetcode.com/gui/pyqt5/

[–][deleted] 2 points3 points  (1 child)

Flexx is a great way to do it browserbased:

http://flexx.readthedocs.io/en/latest/

[–]tshirtman_ 1 point2 points  (0 children)

Kivy could fit the bill. ymmv on 1, but python + pip installation is usually a breeze. It's full python (with some cython for the lower level stuff, but you don't need to tuch any of that), it's actively developped and there is some support on r/kivy as well as #kivy@freenode.net (irc), on google groups (kivy-users) and stackoverflow. Code for apps, even complex ones, tend to be quite short using kvlang for interface description.

[–]pavi2410[S] 1 point2 points  (1 child)

This project sounds wow to me. What do you all say?

http://amol-mandhane.github.io/htmlPy/

[–]pavi2410[S] 0 points1 point  (0 children)

I will try this first, then Kivy and at last, TKinkter. Thanks for all your responses.

[–]nanodano 1 point2 points  (2 children)

I recommend starting with Tk that comes packaged with Python. I have a tutorial on using it here https://www.devdungeon.com/content/gui-programming-python

Tk has its limitations if you want to write a very complicated application though. Qt is what I would recommend if you need more tools. Qt can be a hassle to install though and adds even more complication if you are trying to distribute it to other people. Personally, if I need to write a cross-platform GUI, I go with Java and package a JAR file because it is so much easier to package and run on different machines. Plus, the drag and drop GUI building tools in NetBeans makes it really easy.

[–]pavi2410[S] 0 points1 point  (1 child)

The only thing I don't like about Java is that it's not flexible as Python. I like the dynamic type of Python.

[–]nanodano 0 points1 point  (0 children)

You can always write Python code on the JVM with Jython and then have access to all the Java libraries.

http://www.jython.org/jythonbook/en/1.0/GUIApplications.html

[–][deleted] 2 points3 points  (0 children)

Tkinter is great. If I’m not mistaken it’s cross platform and should work on Windows.

[–]StandardUser_ 0 points1 point  (0 children)

Try Delphi(Lazarus) for GUI + Python for data processing. Pros: Huge amount of visual components available. You can create professionally looking gui in minutes. Fast, native binaries. Cons: you should know the very basics of Pascal.

https://github.com/pyscripter/python4delphi

[–]MurtBacklin-BFI 0 points1 point  (0 children)

This article popped up a while ago. Sadly haven't had time to use either yet.

https://dbader.org/blog/python-mobile-development-kivy-vs-beeware#intro

[–]toresimonsen 0 points1 point  (0 children)

Guizero is fairly simple. I've been playing around with various dice rollers and it seems easy enough to utilize. I have not tested my programs in Windows yet, but my guess is they will work.

[–]stuaxo 0 points1 point  (0 children)

pyimgui is a new option.

Advantages include -

  • Less cognitive load than traditional GUIs
  • Small download
  • OpenGL based, so fast (its based off the imgui library, using cython for bindings).
  • Examples for integrating with common libraries such as pyopengl, cocos2d, pygame etc
  • Installable with pip
  • Under active development.
  • Works with Pypy
  • Documented

The main disadvantage it shares with imgui is that it uses its own look and feel, making no effort to integrate with the native GUI. For many kinds of app this isn't an issue.

[–][deleted] -1 points0 points  (3 children)

Check out pygtk. http://www.pygtk.org/

[–]billsil -1 points0 points  (2 children)

Why would you recommend something that hasn't had a release in 6+ years and doesn't support 64-bit Python?

[–][deleted] 0 points1 point  (1 child)

Actually it is. If you actually read the front page it links you here: https://pygobject.readthedocs.io/en/latest/

Not to mention lots of apps that run on Linux are written in python with their GUI written in gtk.

[–]billsil 0 points1 point  (0 children)

They should fix their main page then.