Re: [Tutor] Finding prime numbers script runs much faster when run via bash shell than idle

2011-04-02 Thread Peter Otten
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

Re: [Tutor] Finding prime numbers script runs much faster when run viabash shell than idle

2011-04-02 Thread Alan Gauld
"Jaime Gago" wrote 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. IDLE is a development environment.

[Tutor] HELP

2011-04-02 Thread ISAAC Ramírez Solano
Hi... My name is Isaac, I need some help to programm in python, I know some things that are really basic like lists and recursivity and with that we shoul create an GPS with a global variable, but what I'm trying to do is to make a function that could call the global variable can I do somethin

[Tutor] FW: HELP

2011-04-02 Thread ISAAC Ramírez Solano
Hi... My name is Isaac, I need some help to programm in python, I know some things that are really basic like lists and recursivity and with that we shoul create an GPS with a global variable, but what I'm trying to do is to make a function that could call the global variable can I do

Re: [Tutor] HELP

2011-04-02 Thread Walter Prins
2011/4/2 ISAAC Ramírez Solano > > Hi... My name is Isaac, I need some help to programm in python, I know some > things that are really basic like lists and recursivity and with that we > shoul create an GPS with a global variable, but what I'm trying to do is to > make a function that could call

Re: [Tutor] HELP

2011-04-02 Thread Alan Gauld
"ISAAC Ramírez Solano" wrote Hi... My name is Isaac, I need some help to program in python, I know some things that are really basic like lists and recursivity I'm not sure what you mean by recursivity, but I'm betting its not what I mean by that term! :-) with that we should create an GPS

Re: [Tutor] Finding prime numbers script runs much faster when run viabash shell than idle

2011-04-02 Thread Jaime Gago
Ok I understand now, thank you very much! On Apr 2, 2011, at 1:05 AM, Alan Gauld wrote: > "Jaime Gago" wrote >> 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 perspec

[Tutor] 'for' iteration stop problem

2011-04-02 Thread Mateusz Koryciński
Hi, My problem is simple for sure, but unfortunately I'm a bit beginner and I've stucked in it. I hope it is not a problem since as I understand this mailing list is for beginners. I have some problem with 'for' loop in algorithm. Code and description for this problem could be find here: http://st

Re: [Tutor] 'for' iteration stop problem

2011-04-02 Thread Alan Gauld
"Mateusz Korycinski" wrote My problem is simple for sure, but unfortunately I'm a bit beginner and I've stucked in it. I hope it is not a problem since as I understand this mailing list is for beginners. No problem, we try to answer questions such as this here. I have some problem with '

Re: [Tutor] 'for' iteration stop problem

2011-04-02 Thread Wayne Werner
On Sat, Apr 2, 2011 at 5:45 PM, Alan Gauld wrote: > > There are other ways but those should cover most eventualities. I find that my preferred way when the loops are nested is to move the loops into a function and then return: def do_something(collection, collection2): for x in collection:

Re: [Tutor] 'for' iteration stop problem

2011-04-02 Thread Steven D'Aprano
Mateusz Koryciński wrote: I have some problem with 'for' loop in algorithm. Code and description for this problem could be find here: http://stackoverflow.com/questions/5520145/how-to-stop-iteration-when-if-statement-is-true Other people have answered your question about exiting nested loops, b