[Tutor] My last (fwd)

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Wed, 4 Sep 2002 10:29:04 -0700 (PDT)


Hi Morne,


Instead of sending just to me, it's often better to send to the
tutor@python.org address.  This is not because I don't like getting email,
but because I personally cannot guarantee a quick or good answer!  By
sending to 'tutor@python.org', all of the tutors here can help you.


You need to give us more details about what doesn't work.  Does Python
give an error "traceback"?  A traceback is something that Python prints
out as a debugging aid.  For example, if we tried something like this:

###
Type "help", "copyright", "credits" or "license" for more information.
>>> 41 + "one"
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: unsupported operand types for +: 'int' and 'str'
###

Those three last lines would be considered the "traceback"; they often
give us enough hints to figure out why a program isn't working.  Do you
get anything like this?



---------- Forwarded message ----------
Date: Wed, 4 Sep 2002 10:50:14 +0200
From: Morne <fromclay@maxitec.co.za>
To: Danny Yoo <dyoo@hkn.eecs.berkeley.edu>
Subject: Re: [Tutor] My last

 Danny thanx for relpying.
Ok so I took your code and copy paste it to the Python shell and it does not
work ?

----- Original Message -----
From: Danny Yoo <dyoo@hkn.eecs.berkeley.edu>
To: Morne <fromclay@maxitec.co.za>
Cc: python tutor <tutor@python.org>
Sent: Wednesday, September 04, 2002 10:14 AM
Subject: Re: [Tutor] My last



 ###
> def getStuff(file):
>     ppplist = file.readlines()
>     for line in ppplist:
>         print "I am looking at line", line
>         if string.file(line, "connect time") >= 0:
>             print "found close"
>             connectSecs = secondsMatcher.search(line).group(1)
>             print "Connected for", connectSecs
>
> def main():
>     f = open("C:/my documents/ppp.log", "r")
>     getStuff(f)
> ###
>