Re: [Tutor] More problems with Learning Python example (fwd)

2005-08-12 Thread Alan G
> Running lots_of_appends 100 times took 0.460 seconds. > Running one_multiply 100 times took 0.000 seconds. <<- ? > Running lots_of_appends 100 times took 0.440 seconds. > Running one_multiply 100 times took 0.010 seconds. > > Is the indicated result a fluke value which I can just > disrega

Re: [Tutor] More problems with Learning Python example

2005-08-12 Thread Alan G
Something odd here... > def do_timing(num_times, *funcs): > totals = {} > for func in funcs: Here you assign func to each function in turn. > totals[func] = 0.0 And here you create a key with it > starttime = time.clock()# record starting time > for x i

Re: [Tutor] More problems with Learning Python example (fwd)

2005-08-12 Thread Danny Yoo
-- Forwarded message -- Date: Fri, 12 Aug 2005 00:29:00 -0500 (CDT) From: "->Terry<-" <[EMAIL PROTECTED]> To: Danny Yoo <[EMAIL PROTECTED]> Subject: Re: [Tutor] More problems with Learning Python example -BEGIN PGP SIGNED MESSAGE- Hash: SHA1

Re: [Tutor] More problems with Learning Python example

2005-08-11 Thread Danny Yoo
> Traceback (most recent call last): >File "timings.py", line 16, in ? > do_timing(100, makezeros.lots_of_appends, makezeros.one_multiply) >File "timings.py", line 12, in do_timing > totals[func] = totals[func] + elapsed > KeyError: > help(KeyError) tells me Mapping key not fou

[Tutor] More problems with Learning Python example

2005-08-11 Thread ->Terry<-
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thanks Danny and Bob. Your explanations not only helped me solve the error, but understand why i got the error. Unfortunately, I have run into another problem with the same example. Here is where I'm at now: My system is Slackware 10.1 and Python ve