Initial commit

This commit is contained in:
Sirin Puenggun 2022-11-30 11:22:38 +07:00
parent 2d71d41d05
commit d9a0e456d2

20
file_read_write.py Normal file
View File

@ -0,0 +1,20 @@
import json
import os
def read_write_command(com):
filename = "history.json"
file_data = {}
try:
with open(filename, "r") as file:
file_data = json.load(file)
except :
pass
file_data = {2:com}
with open(filename, "w") as file:
json.dump(file_data, file, indent = 4)
def delete():
os.remove("history.json")