for key, value in application_list.items():
# computations
x = key # for your chosen key dependent on your conditions
dt = datetime.fromtimestamp(int(x))
如果只想保存第一个键:
for idx, (key, value) in enumerate(application_list.items(), 1):
# computations
if idx == 1:
x = key # for your chosen key dependent on your conditions
dt = datetime.fromtimestamp(int(x))
如果您想存储一个特定的键以备以后使用,只需分配给一个变量,例如
x
,如下所示:如果只想保存第一个键:
相关问题 更多 >
编程相关推荐