[Tutor] confusing installation

2013-02-28 Thread Lolo Lolo
Hi all. Im working through a database tutorial in a book called Core Python Applications. On page 290 it asks of me to install something though its not clear what it is. I think it has to do with SQLAlchemy. It says if you use Python 3 you'll need to get distribute first. You'll need a web brows

Re: [Tutor] timeit: 10million x 1 Vs 1million x 10

2013-02-28 Thread Steven D'Aprano
On 28/02/13 13:27, DoanVietTrungAtGmail wrote: Dear tutors My function below simply populates a large dict. When measured by timeit populating 10 million items once, versus populating 1 million items ten times, the times are noticeably different: I cannot replicate your results. When I try it,

Re: [Tutor] timeit: 10million x 1 Vs 1million x 10

2013-02-28 Thread Alan Gauld
On 28/02/13 02:27, DoanVietTrungAtGmail wrote: --- import timeit N = 1000 # This constant's value is either 10 million or 1 million testDict = {} def writeDict(N): for i in xrange(N): testDict[i] = [i, [i + 1, i + 2], i + 3] print timeit.Timer('f(N)', 'from __main__ import N,