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?
Advertisement
Answer
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