Seite 1 von 1

infinite while loop

Verfasst: Freitag 4. Januar 2008, 13:22
von knish
Hi,

I have two py programs. both have while 1: loops. Lets say File A has one while 1: loop and File B has another while 1: loop. File A has a break statement. File B has no break statement.


File B is running. I now run File A. This file executes the break statement. What I observe is that the File A loops stops working. correct me if I am wrong. What happens when two different infinite while loops execute one after another. Such that the last while loops breaks. Does this cause the first loop to stop too.


How to encounter such issue.


BRgds,

kNish

Verfasst: Freitag 4. Januar 2008, 13:25
von Mad-Marty
only the innermost loop breaks.
the others will run forever without a break or stop condition.

Verfasst: Freitag 4. Januar 2008, 13:30
von BlackJack
@knish: I don't understand the problem at all. You are not running files, you are running at most one python program. If you you really start both modules independent then both loops are completely independent.

Please provide actual code, tell what you expect it to do, and what you get instead.