views:

110

answers:

3

In an effort to continue to hone my teaching abilities, I am taking an opportunity to give a couple presentations at work to a mixed technical and non-technical audience on business automation. I've chosen Python as my language of choice, mostly for its friendly syntax, the rich standard library and wealth of 3rd party libraries, and my own familiarity with the language.

My approach is going to be to give an overview of the language by way of an example "application" that does some repeatable tasks that they may want to accomplish (file copies, Word/Excel automation, etc.) covering some basic programming constructs (loops, functions) and basic language constructs (strings, lists, dictionaries) It's a lot to cram in, but it will be followed up with a "lab" where people can try out some of the techniques they've learned.

What I would like to get are some additional tips:

  1. Should I teach with Python 3.x or Python 2.x? 2.x still has better library support overall, but for the basic automation/scripting that I'm teaching I don't think this will be an issue (e.g. PyWin32 for COM hooks to office on Windows, which has a 3.x distribution)
  2. Should I use the built-in REPL or use something like IPython, which adds some shell-like features that may be useful?
  3. What free online books or teaching materials would you recommend for a non-technical audience? I love Dive into Python as a teaching resource, but I haven't read it recently enough to say if it's geared enough towards a new programmer.

I'm making this a community wiki because I don't think there's any right or wrong answer, and hope that any information provided here can be of use to others trying to accomplish something similar at their own company.

+1  A: 

Take a peek at this page: Python for Non Programmers.

In the past when I taught these types of classes, what mattered most was the set of programming examples. I had a graduated sequence that introduced concepts of the language, but each example was interesting in its own right.

Discussing the language too much will make your audience fall asleep. :-)

Richie
+6  A: 

"Should I teach with Python 3.x or Python 2.x?"

2.6. The completeness of support is central to long-term success for most folks. Anyone that continues beyond the class will -- without a doubt -- try something that's not ready for 3.x and call you with angry words.

Avoid the leading edge in this kind of education. Proven, established working stuff is still new to them and will be hard to grasp.

"Should I use the built-in REPL or use something like IPython...?"

Stick with the rock-bottom basics. The command-line REPL and IDLE. IPython can come later for the few who can make use of it. There have been SO questions from people who confuse IPython interpreter features with the language itself.

This will be very new to some. And non-programmers have enough trouble with IDE's as a concept.

There have been SO questions on how to run Python. The basic concept of "script" has eluded some people. So be prepared to explain the difference between interactive and scripted Python.

"Application Programming" is an opaque concept to some people.

As soon as you possibly can, dive into code-kata examples.

Really solve real problems in front of their eyes.

Avoid discussing syntax as a concept; only discuss syntax with real examples. Don't define "class" or "object" unless they ask. Never mention "lambda". Avoid discussion "duck typing" or "polymorphism" as long as you can. Even very experienced Java programmers get very, very huffy and irritated with Python's approach to type checking.

S.Lott
I disagree about the 2.6 comment. Support for 3.1 is increasing greatly. I predict we'll see an exponential growth in support, where ten libraries start porting because one particular library they rely upon just ported. MySQL connector for 3.1 was just released, which is a key api used in conjunction with other libraries, especially web frameworks. Also, your kind of comment doesn't help in adapting 3.1. If people keep saying "choose 2.6" then it's guaranteed that it'll take forever.
Tor Valamo
@Tor, I would say that Python 2.6 programmers will eventually want, if not need, to learn 3.x. However, for an introductory class I would also (in fact have also :) teach 2.x, for the simple reason that if someone looks up a Python example of something on the internet it is still probably 2.x, and very likely to not work in 3.x. That said, I expect 3.x will soon enough be a mandatory transition as libraries move on, so I do anticipate this changing within the next 2-3 years.
Tim Crone
@Tor Valamo: It depends on the library support not people "saying" which to choose. Once the entire library (90% ±) plus a lot of major frameworks (SQLAlchemy, Django, etc.) are converted, 3.x is obvious and works in a classroom situation. Until there's 90% library AND most major frameworks, 3.1 -- in a classroom setting -- is too risky. If anything fails to work the classroom, the presentation gets derailed around that one, single problem. Best to avoid all risk. It's only preliminary training.
S.Lott
Just want to add that Unladen Swallow is probably merging with 3.2 (or maybe even 3.1), so python 3 will be way faster too. I see your points though, but I don't agree with them. ;)
Tor Valamo
@Tor Valamo: Can't see the point in taking the risk of having someone asking a Very Hard Question about a library package in 3.x world. At that point, all you have are shrugs and what we call sex with the sales person: "they sit on the edge of the bad and tell you how good it will be." It derails too much.
S.Lott
A: 

It really depends on what exactly you're trying to accomplish.

From what I understand, your main goal is to hone your teaching abilities, but to do that, you need to define a specific objective that you're trying to get across.

Since you're presenting to a (at least partially) non-technical crowd, here are some goals that I would personally have:

  1. Make them understand what programming is, at a very high level (i.e., when someone says they are programming something, they should have an idea of what that means).
  2. Allow those that find what you taught to be interesting, and wish to explore it further, as easy a way to programming as possible. This really depends on your crowd, and whether you think some of them might be interested in learning Python for real, but I'd have that as a goal.

Now, to answer your questions in light of these two goals:

Should I teach with Python 3.x or Python 2.x?

It doesn't really matter, in the sense that at the level you're teaching, you're not really going to stumble upon any major difference.

That said, I would go with Python 2.x. The reason is because of goal number 2: if someone out there decides to pick up Python for real, it will probably be easier for them to learn Python 2.x, since more resources are available.

Should I use the built-in REPL or use something like IPython, which adds some shell-like features that may be useful?

Definitely use the built in REPL (more specifically, use IDLE).

At the level you're doing the presentations (as I understand it), I really don't think you're going to do anything for which using IPython will make life easier. The goal will be to present very high level constructs, and the entire focus should be on writing Python code. I wouldn't focus any attention on the environment.

That said, goal number 2 once again dictates that going with IDLE is probably the best choice. If anyone wants to get started using Python at home, it'll be much easier for them to get IDLE up and running (a matter of one installation).

What free online books or teaching materials would you recommend for a non-technical audience?

Honestly, I'd end the presentation with a very complete explanation of how to get and install Python, up to and including how to run IDLE once installed.

I'd then point them to either the help, or Dive Into Python. Just because they're both very readily available.

Hope this helps!

Edan Maor