print time comparison: IDLE versus terminal on ultra 20

sam python.sam at googlemail.com
Sun Oct 8 14:41:06 EDT 2006


hi all,

i continue to footle around on my spanking new ultra 20 (1.8GHz /
Opteron Model 144), gradually trying to get to grips with python and
unix both.

the slow print time in IDLE had already struck me as rather odd.
running programs with heavy print requirements from the terminal was a
major discovery though, printing being so fast as to make everything
appear at once except in the case of literally thousands of items to be
printed.

test case:

import time

time1 = time.time()
for i in range(100):
    print 'go get \'em, son!'
time2 = time.time()

print time2-time1


in IDLE:
4.433 seconds

in terminal:
0.001 seconds

a difference of between 3 and 4 orders of magnitude is rather striking.
anyone know what's going on here? is it a python, a unix thing, or
something else?

sam




More information about the Python-list mailing list