example gives a running timeline checking every 10 seconds
This commit is contained in:
10
example.py
10
example.py
@@ -1,4 +1,5 @@
|
||||
from pcslive import LiveStats
|
||||
import time
|
||||
|
||||
stats = LiveStats()
|
||||
|
||||
@@ -6,6 +7,11 @@ if len(stats.races) > 0:
|
||||
race = stats.races[0]
|
||||
print("Latest timeline update from", race.title, ":")
|
||||
|
||||
race.get_timeline()
|
||||
|
||||
print(race.timeline[0])
|
||||
last_update = ""
|
||||
while True:
|
||||
race.get_timeline()
|
||||
if last_update != race.timeline[0]:
|
||||
print(race.timeline[0])
|
||||
last_update = race.timeline[0]
|
||||
time.sleep(10)
|
||||
Reference in New Issue
Block a user