[Edu-sig] Teaching Python with the Calendar

Kirby Urner urnerk at qwest.net
Sun Nov 14 19:50:46 CET 2004


> Very interesting, Kirby!
> Would you mind to publish the source of the cgi-script,
> e.g. provide it as an attachment?
> As a first step I'd like to try to produce an Austrian version
> of your calendar (different holidays, of course).
> Regards,
> Gregor

Yes.  For now I will send you the code as a separate attachment.  

I pointed my student to edu-sig earlier for some discussion of his
'accessing a class with square brackets' question, and my cgi script may
contain some things he'd prefer to work out himself just now (I did share
the code for a more primitive
http://www.4dsolutions.net/cgi-bin/calendar.cgi to help him get going).
He's preoccupied with hardware issues around a new linux distro at the
moment, and so is running a bit behind in the cgi department.

It's actually two programs:  calendar2.cgi gets the month and year (this
month if none passed in the url), and draws the calendar (using HTML + CSS).
The other program, holidays.py, has the responsibility to return a
dictionary, per given year, containing holidays with 'day numbers' (1-365|6)
as keys.  

A design issue I didn't solve, but could without much effort, is how to
handle it when two holidays fall on the same calendar date.  According to my
student, there's only one such possibility in his mix of religious +
USA-secular.

If you're able to provide an Austria-based module similar to holidays.py,
that has the same API (at least as an option), then I could swap it in, and
still use calendar2.cgi unchanged.  In the meantime, you'd of course be free
to enhance your own version of calendar2.cgi in any direction.

If anyone else wants to develop an alternative holidays module, or is
curious about the code, just let me know and I'll attach the source.

Kirby




More information about the Edu-sig mailing list