-
Notifications
You must be signed in to change notification settings - Fork 1
/
read_test.py
31 lines (27 loc) · 982 Bytes
/
read_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
##############################################
### Read values from files and print these
### continues to the terminal for monitoring
##############################################
import time as timeModule
import os
import pandas as pd
from functions import read
path = 'data/'
# main loop
while(True):
time = read(path + 'time.txt')
gameName = read(path + 'gameName.txt')
homeTeamName = read(path + 'homeTeamName.txt')
awayTeamName = read(path + 'awayTeamName.txt')
homeScore = read(path + 'homeScore.txt')
awayScore = read(path + 'awayScore.txt')
homeFouls = read(path + 'homeFouls.txt')
awayFouls = read(path + 'awayFouls.txt')
df = pd.DataFrame([gameName, time, homeTeamName, awayTeamName, homeScore,
awayScore, homeFouls, awayFouls])
df.index = ['Game', 'Time', 'Home team', 'Away team', 'Home score',
'Away score', 'Home fouls', 'Away fouls']
df.columns = ['Game status']
os.system('cls' if os.name == 'nt' else 'clear')
print(df)
timeModule.sleep(1)