Simple Python UI in 30 mins

in #dev6 years ago (edited)

Python_logo-128.png

Python is my favorite language. You can automate just about any task a computer is capable of with it. I struggled for a while in finding a UI solution for my simple python programs that was straightforward and not overly complex. I am not writing enterprise, or even compiled programs… Simply just little programs for encrypting files, bots, or scraping the web. There quite a few to choose from, but in my opinion they tend to be more complex than needed for my uses. The easiest and fastest solution I’ve found thus far is PAGE. After installing and poking around, you’ll have a simple ui inside of 30 minutes. I’ve used this on both windows and mac, not sure if you can use it on linux.

Installation:
Download & Install PAGE editor from: http://page.sourceforge.net/
Download & Install Active TCL from: https://www.activestate.com/Products/activetcl/

Open the page folder once you’ve installed and double click on ‘page.tcl’.
pageFolder.PNG
The editor will open, and you’ll get a few scattered sub-menus. This throws you off at first, but all you need to do is click on Toplevel inside of the Widget Toolbar.
ClickTopLevel.PNG
This creates the base level of your new ui, from there you van try adding different widgets and labels. In the image I add labels, text fields and buttons. Resizing the Toplevel dictates the size of your ui window. The Attribute Editor populates with attributes according to which widget you have selected in the Widget Tree.
Elements.PNG
Change the element name, color add a command that links to the element.
Command.PNG
When satisfied with your ui, in the top bar go to Gen_Python > Generate Python UI & Generate Python Support Module.
GenPython.PNG
This generates a python file for the ui and one for the functionality of your program. The ui uses tkinter, I’ve used ui generated by PAGE on Windows, Mac and Linux without issue. This ui is definitely limited, it doesn’t look beautiful, and wont scale nicely.

ui.PNG

For speed and simplicity this workflow cant be be beat imo. So download and play around, hopefully you’ll find it useful.

Sort:  

Congratulations @axiom-prime! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You made more than 700 upvotes. Your next target is to reach 800 upvotes.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.20
TRX 0.25
JST 0.038
BTC 97445.74
ETH 3477.06
USDT 1.00
SBD 3.16