Skip to main content

A Pythonic Wrapper for Tkinter

Project description

A Pythonic Wrapper for Tkinter

I’ve always had a love/hate relationship with Tkinter. On the one hand, it almost always comes with Python, which makes it the easiest option for making a GUI in Python. On the other hand, it’s one of the least Pythonic modules in existance.

So I’ve decided to write and share this - FinGUI. It’s a GUI package for Python written in pure Python, meaning it’s trivial to install, unlike pretty much every other GUI package for Python.

Installation

Install via pip:

$ pip install fingui

Done.

If you insist on the (slightly) harder way of installing, from source, you know how to do it already and don’t need my help.

The most up-to-date version of this library can be found on github at https://github.com/TaylorSMarks/FinGUI

Quick Start

Once you’ve installed, you can really quickly verified that it works with just this:

>>> from fingui import Entry
>>> e = Entry()
>>> e.set('Hello World!')

That’ll work right from your command line. You can also drop the same code into a script and run it with no modification.

Note the boilerpoint we didn’t deal with, because it’s all automatically handled:
  • We didn’t call mainloop().
  • We didn’t need to create a root object (although we could have).
  • We didn’t need to call pack().

Also note that Entry has a set() method! Unlike the variant in Tkinter, ours has the methods you would expect.

The toplevel example.py file demonstrates how you can combine the Entry and Menu classes to quickly make a polished AutocompletePathEntry class in under 50 lines of code.

Documentation

I’ve tried to include docstrings with all the functions and classes, so things like this should work:

>>> import fingui
>>> help(fingui)

If this project grows large enough, I’ll try to create some more formal documentation for it.

Requirements

FinGUI has been tested on Python 2.7 on OS X 10.11 and Windows 7. It is intended to work on both Python 2.6+ and 3.2+, with any OS that supports Tkinter. It probably falls short on Python 3; I wouldn’t know because of how rarely I touch it. Please submit pull requests to fix anything that doesn’t work on Python 3.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
fingui-0.2.4.tar.gz (8.5 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page