About 347,000 results
Open links in new tab
  1. How do you run your own code alongside Tkinter's event loop?

    He's gotten most of his code written, and it works nicely, but the birds need to move every moment. Tkinter, however, hogs the time for its own event loop, and so his code won't run. Doing …

  2. How do I parallelize a simple Python loop? - Stack Overflow

    Mar 20, 2012 · This is probably a trivial question, but how do I parallelize the following loop in python? # setup output lists output1 = list() output2 = list() output3 = list() for j in range(0, 10): # calc

  3. python - How to make program go back to the top of the code instead …

    2 Python has control flow statements instead of goto statements. One implementation of control flow is Python's while loop. You can give it a boolean condition (boolean values are either True or False in …

  4. python - How to run a script forever? - Stack Overflow

    I need to run my Python program forever in an infinite loop.. Currently I am running it like this - #!/usr/bin/python import time # some python code that I want # to keep on running # Is this...

  5. python - looping back to specific point in code - Stack Overflow

    I am a brand new in Python. Instead of using loop, I used recursion to solve this problem by calling chosen_pokemon () itself in block of else statement

  6. Example use of "continue" statement in Python? - Stack Overflow

    The definition of the continue statement is: The continue statement continues with the next iteration of the loop. I can't find any good examples of code. Could someone suggest some simple cases

  7. python - Run certain code every n seconds - Stack Overflow

    Aug 3, 2010 · Is there a way to, for example, print Hello World! every n seconds? For example, the program would go through whatever code I had, then once it had been 5 seconds (with time.sleep()) …

  8. python - How to retry after exception? - Stack Overflow

    I also prefer a for-loop for retrying. A wrinkle in this code is that, if you want to re-raise the exception when you give up trying, you need something like "if attempt=9: raise" inside the except clause, and …

  9. python - How to kill a while loop with a keystroke? - Stack Overflow

    Nov 1, 2012 · the following code works for me. It requires openCV (import cv2). The code is composed of an infinite loop that is continuously looking for a key pressed. In this case, when the 'q' key is …

  10. python - How to stop one or multiple for loop (s) - Stack Overflow

    I find it easier to understand with the use of a loop and it will stop both for loops that way. The code below also return the True/False as asked when the function check_nxn_list () is called. Some …