Seems there is problem with passing author's name to database input.
This seems to be an issue --> E3 is an input for Tkinter GUI and on this prints this inputs is fine. But on delete seems like object of JsonObj does not see that var inside:
` def del_authors(self, author_name=" "):
with open("writer.json", encoding='utf-8') as jsondata:
data = json.load(jsondata)
found = False
for i in data:
if i == author_name: # here author name is NOT PASSED!!!!!
found = True
data.pop(i)
showinfo(
title='Remove record',
message='Record' + author_name + 'has been removed!'
)
break
if found == False:
showinfo(
title='Remove record',
message='Record cannot be found!'
)
# overwrite json
open("writer.json", "w").write(
json.dumps(data, sort_keys=True, indent=4, separators=(',', ': '))
)
return author_name`
Seems there is problem with passing author's name to database input.
This seems to be an issue --> E3 is an input for Tkinter GUI and on this prints this inputs is fine. But on delete seems like object of JsonObj does not see that var inside:
def del_record(): read_rec = E3.get() print("User want to delete" + read_rec) print("JSON operation...") delete = JsonObj.del_authors(str(read_rec)) print("UUSU" + str(delete))
` def del_authors(self, author_name=" "): with open("writer.json", encoding='utf-8') as jsondata: data = json.load(jsondata)
Please have a look @hezyrof1997 --> https://github.com/kpiechura/speechy-recon-app/tree/kp/dev_sr_debug