About 977,000 results
Open links in new tab
  1. python - How do I terminate a script? - Stack Overflow

    also sys.exit () will terminate all python scripts, but quit () only terminates the script which spawned it. David C. Over a year ago Do you know if this command works differently in python …

  2. What does end=' ' in a print call exactly do? - Stack Overflow

    Jul 16, 2023 · The question you found is mainly discussing the difference between Python2 and Python3 since there is no argument end for print in Python2 (actually in Python2 print is not a …

  3. How do I abort the execution of a Python script? [duplicate]

    Jan 26, 2010 · The Python docs indicate that os._exit () is the normal way to end a child process created with a call to os.fork (), so it does have a use in certain circumstances.

  4. How to stop/terminate a python script from running?

    If your Python program doesn't catch it, the KeyboardInterrupt will cause Python to exit. However, an except KeyboardInterrupt: block, or something like a bare except:, will prevent this …

  5. python - How to exit an if clause - Stack Overflow

    If you're asking how to make code loop a set number of times, then the usual Python idiom is to make a range and iterate over it. But if you've decided that the code now needs to loop, then …

  6. How do I stop a program when an exception is raised in Python?

    Jan 13, 2009 · If we were in C++ land, I would think that you're looking for the equivalent of "catch throw" in GDB. How ever, in Python the exception carries a backtrace telling you exactly …

  7. Terminating a Python Program - Stack Overflow

    What command do you use in python to terminate a program? i.e. the equivalent of "end" in basic, or "quit" in BASH. I see that "break" takes you out of a loop, and "quit" is all tied up with "cla...

  8. Exiting a program from an If/ELSE statement with Python

    May 2, 2015 · Not sure how, is it possible to call a function within an IF statement? For example, if i created a function called exit and placed it at the end of my program, am I able to call it eg. …

  9. Programmatically stop execution of python script? [duplicate]

    Is it possible to stop execution of a python script at any line with a command? Like some code quit() # quit at this point some more code (that's not executed)

  10. How do I measure elapsed time in Python? - Stack Overflow

    The python cProfile and pstats modules offer great support for measuring time elapsed in certain functions without having to add any code around the existing functions.