Reputation: 45
I am currently writing a python script. As I want it to check an API data in real time, so I want it to call the API function every 1 second. How should I done please?
Upvotes: -2
Views: 67
Reputation: 5713
You can use the following code
import time
while True:
call_api()
time.sleep(1)
here call_api
will be called until you stop the program by ctrl+c
Upvotes: 1