-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrun_predict.py
25 lines (24 loc) · 863 Bytes
/
run_predict.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
from subprocess import Popen, PIPE, STDOUT
from connectDB import ConnectDB
from crawler_data_binance import crawlerDataBinance
import time
if __name__ == '__main__':
start_time = time.time()
# get data from Binance
crawler = crawlerDataBinance()
crawler.insert_coin_info_to_db()
crawler.insert_symbols_candlestick_data()
print("Total time get data: %f"%(time.time() - start_time))
start_time = time.time()
# predict data
DB = ConnectDB()
list_coin = DB.get_list_coin_info("ETH")
for coin in list_coin:
print(coin)
try:
p = Popen('python3 predict.py -id %s -symbol %s'%(coin[1], coin[0]), shell=True,
stdout=PIPE, stderr=STDOUT)
retval = p.wait()
except Exception as e:
print(e)
print("Total time predict: %f" %(time.time() - start_time))