-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
39 lines (37 loc) · 1.61 KB
/
main.py
File metadata and controls
39 lines (37 loc) · 1.61 KB
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
32
33
34
35
36
37
38
39
import os, sys
import time
import config
from modules.get_live_data import LiveDataParser
import pandas as pd
if __name__ == '__main__':
while True:
data_parser = LiveDataParser()
data_parser.get_parser()
if data_parser.flag==1:
while True:
try:
if config.game_ids:
print(1)
origin_data = pd.read_excel(os.path.join(config.RESULT_DIR, os.listdir(config.RESULT_DIR)[0]))
origin_data = origin_data.iloc[:,1:]
data = data_parser.get_live_data()
data = pd.concat([origin_data, data], axis=0)
config.game_ids = data.loc[:, '게임id']
config.game_ids = list(config.game_ids)
data.to_excel(os.path.join(config.RESULT_DIR, 'result.xlsx'))
print('데이터가 저장 되었습니다.')
time.sleep(10)
break
else:
print(2)
data = data_parser.get_live_data()
data.to_excel(os.path.join(config.RESULT_DIR, 'result.xlsx'))
config.game_ids = data.loc[:, '게임id']
config.game_ids = list(config.game_ids)
print('데이터가 저장 되었습니다.')
time.sleep(10)
break
except:
print('엑셀이 열려있습니다. return')
else:
time.sleep(10)