Is there any way for printing live data which is being scraped from websites in a single location. Consider the below example for understanding my question.
import requests
import time
print("Selling \t \tbuying")
for i in range(100):
time.sleep(5)
r = requests.get("https://api.binance.com/api/v/depth",params=dict(symbol="DOTUSDT"))
a = r.json()
b=a['asks'][0][0]
c=a['bids'][0][0]
print(b,"\t \t",c)
This program will print output for every 5 seconds new lines will print like this below
Selling buying
18.58900000 18.58800000
18.59100000 18.58800000
18.59500000 18.59400000
18.59300000 18.59200000
18.60000000 18.59900000
18.61500000 18.61400000
18.61900000 18.61700000
What i need is , it should not print new values in new lines. It should update with new values in same first line.