Win a copy of Head First Go this week in the Go forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Want to start making GUI for python apps  RSS feed

 
Ranch Foreman
Posts: 135
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys

feel i want to start making GUIs even for my small programs
sick of trying to space things out on the console etc
would be more fun to start using GUIs

been looking at
pyqt and kivy

both have their pros and cons
and i know nothing except there are loads of tutorials available for both

which is the better for the following criteria
support and community
ease of use
learning something useful (i assume both have been around a long time and arent going anywhere)

or maybe you have a better option
 
Saloon Keeper
Posts: 20514
115
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I last used tkinter, which is considered as the standard for Python GUI apps and comes pre-installed, I think. I was doing stuff for the Raspberry Pi.

Kivy's strength seems to be that it's multi-platform, including for Android. PyQt5 is supposed to run on Android, but not PyQt4.
 
wayne brandon
Ranch Foreman
Posts: 135
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it ok? or should i look elsewhere?
 
Tim Holloway
Saloon Keeper
Posts: 20514
115
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is what OK?
 
wayne brandon
Ranch Foreman
Posts: 135
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tkinter

is it pretty powerful compared to kivy or pyqt and how easy is it to use

is there no gui designer that can be used by python
kind of like visual studio designer for c#
 
Tim Holloway
Saloon Keeper
Posts: 20514
115
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the best-known GUI design tools for the Linux/Unix world is glade, although I don't recall how well it works with Python. There's a glade-inspired GUI designer specifically for Python tkinter called "pygubu". I did my work the hard ways, though, so I don't know details.

Bear in mind that Windows GUI design has traditionally been based on absolute placement. Put control Z at pixel co-ordinates Z and Y. The GUI designers for Unix-style environments are more into relative positioning and a lot of them use layout managers. That's not just tkinter, but Java's own GUI systems, and Android. The reason for this is that screen sizes can vary widely on these platforms, so using an absolute positioning format could potentially shove controls off-screen where they might become unusable (I've had a few websites pull this stunt on my phone, for example).

So if you're not familiar with layout managers and packing controls into them, consider this an educational opportunity.

Just of historical interest: tkinter is descended from the Unix world. Originally, Unix terminals were text-only, and if you were lucky, you'd have a fancy terminal with screen positioning, and MAYBE color. If not, you might have a TeleType™ terminal with a roll of paper scrolling though it. So early user input systems started out limited.

The first attempt at a "GUI" was the termcap system, which allowed you to output "universal" screen positioning and color commands and have the OS translated them into the vendor-specific codes used by your brand of terminal. But as people got more ambitious, support systems were created. One of the earliest ones was Tk, which stood for "toolkit". It was generally paired with "tcl" - the Tool Control Language. TCL wasn't a real programming language, so much as a way to glue together Unix programs to achieve a desired purpose. Bear in mind that Unix was all about small programs that did one thing and did it well, as opposed to massive "do-everything" programs. Having machines with 4K RAM helps encourage that sort of thing.

Python was also developed in the Unix/Linux world, and while probably the vast majority of Python apps (excluding webapps) has been strictly command-line, there have been times when something more was desirable, and it was natural for them to turn to a known (and debugged!) system like Tk and adapt it. Python is great at adaptations. So from there we get tkinter.

Note also that while most of us operate in full pixel-mode GUIs these days, there's still a need for text-mode GUIs like Tk was originally designed for. If I want to remote-shell dialin to one of my servers, they don't have windowing systems running. Why blow 150MB or so of RAM on a system that mostly serves up data and web pages? So a text GUI gives me form data input without the overhead of a windowing system. And back in the days of 9600-baud modems, it was even more useful!
 
wayne brandon
Ranch Foreman
Posts: 135
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
very interesting, how the h do you know all this stuff!!!
 
Tim Holloway
Saloon Keeper
Posts: 20514
115
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

wayne brandon wrote:very interesting, how the h do you know all this stuff!!!



A long and evil career.

Also Google.
 
wayne brandon
Ranch Foreman
Posts: 135
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
" So a text GUI gives me form data input without the overhead of a windowing system."

are you just talking about a text menu system?
 
Tim Holloway
Saloon Keeper
Posts: 20514
115
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

wayne brandon wrote:" So a text GUI gives me form data input without the overhead of a windowing system."

are you just talking about a text menu system?



No, but it's perhaps surprising how much a character-based UI and a pixel-based UI have in common. Which is good. Red Hat did a whole series of system configuration utilities that had both TUI (text UI) and GUI (pixel UI) versions, so it saved them some work. Although these days, they have a preference for web-based utilities, it seems.
 
Greenhorn
Posts: 26
Python VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Wayne,

Since the first of this year or so, Glade (and the underlying wsPython libraries has become sufficiently stable to design full fledged GUI front ends for Python programs.  The difference is that Glade allows designing a GUI interface -- with a GUI tool.  Wth the other GUI libraries, such as Tcl/Tk, the interface has to be hand coded line by line.  (QT5 may have s similar tool but I have not investigated because of the licensing constraints.)  If someone knows of a GUI tool for Tcl/Tk that is similar to Glade, please add that to this thread.

There is an alternative for adding a simple GUI to a batch oriented Python tool.  That library is called PySimpleGUI (https://github.com/PySimpleGUI).  It supports several GUI frameworks and is quite usable if the desired GUI is not too complex.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!