Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wiseplat
GitHub Repository: wiseplat/python-code
Path: blob/master/ invest-robot-contest_NeuroInvest-main/NeuroInvest/get_pairs.py
5931 views
1
from os import path
2
from time import time
3
4
pairsFile = "api-cache/pairs.json"
5
6
if not path.isfile(pairsFile) or int(time()) - path.getmtime(pairsFile) > 5 * 60:
7
import json
8
from trade_tuples import tradesTuple
9
pairs = []
10
for tradeTuple in tradesTuple:
11
pairs.append(tradeTuple.getName())
12
13
with open(pairsFile, 'w') as file:
14
json.dump(pairs, file)
15
16
#with open(pairsFile, 'r') as file:
17
# print(file.read())
18
19
20