Overview to students re Python & GUIs: open to improvement
Below is some "big picture" text I plan to use in my cut and paste in my comments back to a student after they pass one of our GUI projects, all Tk endeavors. I just cobbled it together today in fact. If any edu-sig subscriber sees aspects to which I am apparently blind and should mention, I'd be happy to write a next draft with more comprehensive overview. My goal is to provide some background. We only have three GUI projects (all in Tk) and then move on. I want students to appreciate the wider world in which they've but dabbled (of course any given student may have an extensive background in GUI stuff for all I know, this is not CS0 or CS1 in that we get people with decades of coding experience, just wanting to pick up Python as another tool in their tool belt). Kirby Urner O'Reilly School of Technology ==== Note that Python-the-language stays reasonably small in that GUI stuff is relegated to 3rd party libraries, with the exception of the bundled Tk, which we're using. The core language does not concern itself with any one particular widgets solution (in contrast, some languages incorporate widgets and are not easily used with anything 3rd party). There's also a nifty turtle module for doing turtle graphics implemented in Tk, as a part of the standard library. I encourage you to check it out. John Zelle is one of the authors (not an O'Reilly author) who exploits Tk in his introduction to Python courses. I've seen air traffic control system written in Python with a Tk canvas to show airplane position. All of which is to say: Tk, the library, is a really nice cross-platform GUI toolkit, but you are not limited to that, even in open source / free world. If GUI coding is your thing, make sure to check out (or read up on): wxPython, GTK+ and QT. In addition, Jython, the version of Python implemented in Java, gives you access to everything Java has. win32all extension library lets you tap in to native Windows GUI objects. IronPython, implemented in C#, gives you access to whatever your .NET or Mono platform has in store. In other words, Python-the-language is able to control a large and growing number of GUI widget libraries. Tk is a great example of one of them and in learning to control Tk, you're getting a taste of GUI event driven programming in general. I should add that a lot of GUI stuff is these days handled in the browser if possible, i.e you need to count HTML/CSS + JavaScript as a GUI layer. In that case. Python is typically server-side, updating JavaScript via JSON, but not directly in control of your widgets.
participants (1)
-
Kirby Urner