mirror of
https://github.com/NanjingForestryUniversity/supermachine-tobacco.git
synced 2025-11-08 14:23:55 +00:00
[ext] 增加了喷阀计数功能(未测试)(改掉了一个没有写入权限的bug)
This commit is contained in:
parent
e62fdf3630
commit
e74aad7b36
@ -282,7 +282,7 @@ def valve_log(log_path: pathlib.Path, valve_num: [int, str]):
|
|||||||
将喷阀的开启次数记录到文件log_path当中。
|
将喷阀的开启次数记录到文件log_path当中。
|
||||||
"""
|
"""
|
||||||
valve_str = "截至 " + datetime.now().strftime('%Y-%m-%d %H:%M:%S') + f' 喷阀使用次数: {valve_num}.'
|
valve_str = "截至 " + datetime.now().strftime('%Y-%m-%d %H:%M:%S') + f' 喷阀使用次数: {valve_num}.'
|
||||||
with open(log_path) as f:
|
with open(log_path, "w") as f:
|
||||||
f.write(str(valve_str))
|
f.write(str(valve_str))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user