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

You can't do that without very carefully doing some really bad things first.

Even in the same program, each loop is a separate entity. There is no reason why a loop in one program file should affect a loop in another.

If A eventually stops, then it will stop, no matter what B does.
If B never stops, it will never stop, no matter what A does.

Hope this helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.