[NCLUG] Python Rox

Stephen Warren swarren at wwwdotorg.org
Wed Oct 15 18:11:22 MDT 2008


Jim Hutchinson wrote:
> As some of you may know I work at Windsor high school. I was talking with
> our programming teacher and she was saying she would love to teach Python
> but didn't have time to learn it. From what little I've played with it I
> told her it was pretty easy and she seemed interested. I was wondering if
> any of the Pythoners on the list would ever consider any kind of mini cram
> course to help people get started. I bet we could run in one our labs here

> (all windows based now but that shouldn't matter, should it?).

No, Python works great on Windows, as well as Mac, Unix, and others.

One thing I didn't mention in my congruity talk yesterday was that
congruity has been tested on Linux and Windows, and probably works on
Mac and other Unix too. In all cases, the operation and features are
identical and visually almost identical. The only platform specific code
is 2 lines in the Python code that wraps libconcord (because the DLL
filename is different on different platforms).

> Right now she does VB and C++.

Hmm. I can certainly understand VB. It isn't the world's worst language,
although perhaps not the best, and Microsoft's IDEs are actually very
good for productivity. Heresy, but I prefer MS's IDEs over anything I've
used on Linux (Eclipse, KDevelop, non-IDE editors, ...)

I'd have to disagree with teaching C++ as a first language, unless one
was extremely careful to limit the teaching to a very well defined
simple subset of the language. I'm not too enamoured with full C++ as a
language for real development either.

> Can Python be programed in any way similar to
> the "build a gui" model of VB? I don't if that is important or not but just
> curious.

The thing about VB and MS C++ is that there's a standard GUI toolkit as
part of the language or IDE (MFC in the C++ case). For Python, there are
 a number of choices, such as wxPython/wxWidgets, Tk, ... This somewhat
biases usage of MS IDEs towards writing GUIs, or at least enables it,
and makes a Python GUI designer (with full features, support, large
community) a little harder since there's not a single target widget set.

Python is a completely general purpose language; many Python
applications are command-line text-mode applications, or completely
hidden server-based programs. What I'm saying is that the GUI side isn't
quite so core and relevant, even though it's perfectly possible to
create great-looking GUIs with Python.

One thing you might want to check out is Wingware.com. They ship a
Python IDE written in Python, I believe using the Qt widget set, and
cross platform. I don't *think* it has a GUI builder. As an editor/IDE
just for Python, I think it's probably one of the best. I would use it
if I programmed enough Python to make purchasing it worthwhile.
Unfortunately, I do C 95% of the time. Perhaps they give educational
discounts?

I personally believe that concentrating on GUI programming (other than
as just another tool) kinda goes against the point of learning
programming anyway. I'd rather see basic first principles such as
algorithms and data structures taught first (albeit of course starting
simple...) I can see however that this might make programming seem
dry/stodgy/boring though.

What I might suggest is somebody writing a very simple-to-use GUI
infrastructure that kids then plug the algorithms into. For example,
write a graphics toolkit that creates a window, draws lines, changes
line colors etc. with just 3 simple calls. Then, you could use this to
teach the children LOGO[1], but with Python syntax. (i.e. teach them to
write algorithms to draw square, house, plant, ... but not have to know
anything about windows, widgets, graphics contexts, ...)

Anyway, I'd be willing to put some time into helping out get Python
taught if you need. Hopefully this can be fit in around my baby/family!
If this entails "teaching the teacher", perhaps a good start would be
for her to turn up to a hacking society and talk to a few Python users
face to face.

Sorry if I'm rambling; probably still in a brain-fart state due to being
somewhat ill today...

[1] http://en.wikipedia.org/wiki/Logo_programming_language



More information about the NCLUG mailing list