update textbox print message

This commit is contained in:
misyaguziya
2023-06-15 01:03:36 +09:00
parent 35cba754cc
commit cb5b4f4e49
3 changed files with 45 additions and 48 deletions

View File

@@ -1,8 +1,17 @@
import json
import datetime
def save_json(path, key, value):
with open(path, "r") as fp:
json_data = json.load(fp)
json_data[key] = value
with open(path, "w") as fp:
json.dump(json_data, fp, indent=4)
json.dump(json_data, fp, indent=4)
def print_textbox(textbox, message):
now = datetime.datetime.now()
now = now.strftime('%H:%M:%S')
textbox.configure(state='normal')
textbox.insert("end", f"[{now}]{message}\n")
textbox.configure(state='disabled')
textbox.see("end")