Jaime Gago wrote:

> I wrote a simple piece of code as an exercise to an online -free- class
> that finds prime numbers. When I run it via IDLE it's taking way more time
> than if I run it via a (bash) shell (on Os X 10.6) while doing $>python -d
> mypp.py
> 
> I'm really curious from a performance perspective as to what could cause
> such a noticeable difference.

Displaying text in Idle's Python Shell window has significant overhead

If you remove the line

>         print prime_counter, 'found so far'

from your script it should take roughly the same time to run via bash and in 
Idle.

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to