On 6/13/05, Chuck Allison <[EMAIL PROTECTED]> wrote:
...
> they can handle just fine. After a little experience with the
> interpreter, they can easily pick up methods:
> 
> words = s.split()
...

I believe that "dir( )", when combined with an interactive shell, is
the most powerful command in Python. For an example, I made an
apparently overly-complicated database to interpret my school's
records. When I was trying to figure out which rooms were used by
which teachers (in both directions--room by teacher and teacher by
room), I started by doing dir(school) to remember what my categories
had been, and then eventually figured out what I could loop over and
what attribute I wanted. I eventually remembered that
school.classes.periods.teachers could be compared to
school.classes.periods.rooms in order to come up with what I wanted.

This is also how I explore modules with which I am not familiar, and
one of the first things I ask my students to do is to

import math
dir(math)
_______________________________________________
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig

Reply via email to