本文整理汇总了Python中config.Configuration.get_start_time方法的典型用法代码示例。如果您正苦于以下问题:Python Configuration.get_start_time方法的具体用法?Python Configuration.get_start_time怎么用?Python Configuration.get_start_time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类config.Configuration
的用法示例。
在下文中一共展示了Configuration.get_start_time方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: open
# 需要导入模块: from config import Configuration [as 别名]
# 或者: from config.Configuration import get_start_time [as 别名]
#!/usr/bin/env python3
__author__ = "Rafał Prusak"
__doc__ = "Skrypt zapisujący informację o pogodzie"
import json
from config import Configuration
from wheather import WheatherGenerator
from datetime import datetime, timedelta
from dateutil import parser
if __name__ == '__main__':
result = {}
Configuration.init()
start_time = Configuration.get_start_time()
time = parser.parse(start_time)
time = time - timedelta(hours=8)
i = 1
while i <= 10000:
try:
temperature = WheatherGenerator.get_temperature(time)
result[str(time)] = temperature
print(i, temperature, str(time))
time = time + timedelta(minutes=10)
i += 1
except:
print("koniec kluczy api!")
break
with open('data.txt', 'w') as outfile:
示例2: __init__
# 需要导入模块: from config import Configuration [as 别名]
# 或者: from config.Configuration import get_start_time [as 别名]
def __init__(self):
Configuration.init()
self.client = Client(Configuration.get_start_time())
self.state = None