我正在记录带有时间戳的传感器读数。
我想以当前日期和时间名称格式保存文件,例如2019-08-20-15-20。
有什么想法吗?
write_fmtt = " ".join("%4.8f" for _ in timestamped_camera_readings)
timestamped_camera_readings = np.append(float(timestamp),[arr1 , arr2 , arr3 , arr4])
write_fmtt += " %.0f"
with open("sensor reading.txt", "ab") as ff:
np.savetxt(ff, np.expand_dims(timestamped_camera_readings, axis=0),fmt='%f')
答案 0 :(得分:1)
您可以执行以下操作:
[
{
"id": 1,
"name": "1",
"colors": [
{
"id": 1,
"stocks_id": 1,
"color_name": "Red",
"icon": "111.png",
"images": [
{
"url": "111-111.png"
}
]
},
{
"id": 2,
"stocks_id": 2,
"color_name": "green",
"icon": "222.png",
"images": [
{
"url": "111-111.png"
}
]
}
],
}
]