python time delay
import time
while True:
print("This prints once a minute.")
time.sleep(60) # Delay for 1 minute (60 seconds).
python time delay
import time
while True:
print("This prints once a minute.")
time.sleep(60) # Delay for 1 minute (60 seconds).
how to use python to sleep if the user is not using the system
import time
print("This is how to pause a program")
time.sleep(5)
print("Did you saw that i slept for 5 seconds")
python delay
>>> import time
>>> time.sleep(3) # Sleep for 3 seconds
how to use python to sleep if the user is not using the system
import time
import requests
from pprint import pprint
try:
Api_key = "Your api key"
city_or_country = str(input('Write a "city" or "Country" name for which you want the weather:- '))
print("Fetching Data of",city_or_country)
time.sleep(4)
URL = "https://api.openweathermap.org./data/2.5/weather?appid=" + Api_key + "&q="+ city_or_country
weather_data = requests.get(URL).json()
pprint(weather_data)
except ValueError:
print("incorrect input or API KEY")
making a function wait in python
from time import sleep
>>> sleep(4)
wait in python
#Wait in python
#Module required - time
import time
#Wait in for the time you put
time.sleep(0.5)
print('Wait in python')
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us