Writing to a certain line?

John Machin sjmachin at lexicon.net
Wed Jun 7 01:27:18 CEST 2006


On 7/06/2006 7:46 AM, Tommy B wrote:
> 
> Umm... I tried using this method and it froze. Infiinite loop, I'm
> guessing.
> 

Don't guess.

Instead:

(1) Put some print statements into your code to show what is happening:
(a) before start of loop (b) one or more salient points inside loop (c) 
at (expected) loop termination point.

(2) If that doesn't point you at the problem, ask again, showing the 
actual whole .py file that you ran -- copy/paste, don't re-type what you 
thought you might have run :-)

It would also help if you described what "froze" means. Evidence of disk 
activity? Evidence of CPU activity? Did recovery involve merely closing 
the process's window, or did you need to re-boot?

Also potentially helpful in getting better help: what version of Python; 
what operating system; are you running your code in an IDE (e.g. IDLE) 
or at the command line?

HTH,
John



More information about the Python-list mailing list