Answers for "how to pause a python script while running in commandline"

1

command prompt pause in python

# Don't use os.system("pause"), it is very slow because it needs to create
# an entire shell process. Use this instead:

import getch

def pause():
  print("Press any key to continue . . . ")
  getch.getch()
Posted by: Guest on December-29-2020
0

how to pause a python script

import time

time.sleep(amount of seconds you want to pause the script for)


Example : 
  
import time
secondstogo = input("How much seconds do you want to wait? : ")
print(f"waiting {secondstogo} seconds")
time.sleep(secondstogo)
Posted by: Guest on September-24-2021

Code answers related to "how to pause a python script while running in commandline"

Python Answers by Framework

Browse Popular Code Answers by Language