如何打印以更改输入值
import cryptowatch as cw
time = input("Time:") #15m, 1h , 1d
x = cw.markets.get("KRAKEN:ATOMEUR", ohlc = True, periods = [time])
print(x.of_15m[1][4]))
例如:
time = input("Time:") #1h
print(x.of_1h[1][4])
或:
time = input("Time:") #1d
print(x.of_1d[1][4])
编辑: 我留下更多的信息
cryptowatch-sdk
https://github.com/cryptowatch/cw-sdk-python
函数所在的模块文件:(第255行)
https://github.com/cryptowatch/cw-sdk-python/blob/master/cryptowatch/resources/markets.py
因为我没有安装
cryptowatch
,所以我无法真正正确地测试它,但我认为它可以工作。它使用用户的输入确定x
对象属性的名称,然后使用getattr()
检索其当前值相关问题 更多 >
编程相关推荐