About 390,000 results
Open links in new tab
  1. What does "while True" mean in Python? - Stack Overflow

    Feb 13, 2020 · The while True: form is common in Python for indefinite loops with some way of breaking out of the loop. Learn Python flow control to understand how you break out of while …

  2. python - ¿Cómo funciona un bucle while True? - Stack Overflow …

    Mar 2, 2018 · Quisiera saber cómo funciona un bucle while True: en Python 3. ¿Es posible hacerlo cambiando True por False? En caso de ser posible, ¿Cómo funcionaría?

  3. python - What's the difference between "while 1" and "while True ...

    Jul 10, 2016 · The builtin boolean type didn't exist till Python 2.3 so code that was intended to run on ancient versions tends to use the while 1: form. You'll see it in the standard library, for …

  4. How to break out of while loop in Python? - Stack Overflow

    Jan 30, 2013 · Consider rephrasing "Don't use while True and break statements. It's bad programming." While I try to avoid them as a general rule, many times I have simplified logic …

  5. How would I stop a while loop after n amount of time?

    how would I stop a while loop after 5 minutes if it does not achieve what I want it to achieve. while true: test = 0 if test == 5: break test = test - 1 This code throws me in an

  6. python - while True vs while {condition} - Stack Overflow

    Edit: Does Python prefer to do while True and have the condition use a break inside the loop, or was that just an oversight on the author's part as he tried to explain a different concept? …

  7. Python Threading: Multiple While True loops - Stack Overflow

    Mar 1, 2017 · Do you guys have any recommendations on what python modules to use for the following application: I would like to create a daemon which runs 2 threads, both with while …

  8. python - Alternate syntax for "while True" loop? - Stack Overflow

    May 13, 2016 · @Lotte, yes. while True is a great statement until a condition is set. If you can, convert your while loop to a for loop, but if you need to convolute your code to do so, while …

  9. python - Close a While True Loop from another While True - Stack …

    Mar 26, 2023 · The issue is that the loop (While True) I made to keep the app running after an exception, is what now denies closing the app. So if you type "exit", the app restarts and go …

  10. Else clause on Python while statement - Stack Overflow

    Jul 21, 2010 · The better use of 'while: else:' construction in Python should be if no loop is executed in 'while' then the 'else' statement is executed. The way it works today doesn't make …