From e74aad7b363d8a235d98a35d9f77d7b8d7eb8a5f Mon Sep 17 00:00:00 2001 From: FEIJINTI <83849113+FEIJINTI@users.noreply.github.com> Date: Mon, 5 Sep 2022 10:24:38 +0800 Subject: [PATCH] =?UTF-8?q?[ext]=20=E5=A2=9E=E5=8A=A0=E4=BA=86=E5=96=B7?= =?UTF-8?q?=E9=98=80=E8=AE=A1=E6=95=B0=E5=8A=9F=E8=83=BD=EF=BC=88=E6=9C=AA?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=EF=BC=89(=E6=94=B9=E6=8E=89=E4=BA=86?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=B2=A1=E6=9C=89=E5=86=99=E5=85=A5=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=9A=84bug)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/__init__.py b/utils/__init__.py index aeddc9b..ab9e5a2 100755 --- a/utils/__init__.py +++ b/utils/__init__.py @@ -282,7 +282,7 @@ def valve_log(log_path: pathlib.Path, valve_num: [int, str]): 将喷阀的开启次数记录到文件log_path当中。 """ 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))