Dec-24-2019, 03:51 PM
(This post was last modified: Dec-24-2019, 03:52 PM by LagratteCchouette.)
Thank you so much,
And if I understood correctly...
but i still miss some notions
And if I understood correctly...
but i still miss some notions
# Delete textbox after records combo_auteur.delete(0, Tk.END) combo_theme.delete(0, Tk.END) entry_citation.delete('1.0', END) entry_verset.delete('1.0', END) entry_ref.delete('1.0', END)I still have an error message
Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 1705, in __call__ return self.func(*args) File "C:\Users\xxxx\Documents\PythonDevProgramme\MnesisProject\main5.py", line 358, in <lambda> command=lambda : save_citation(combo_auteur.get(), combo_theme.get(), entry_citation.get('1.0', END), entry_ref.get('1.0', END))) File "C:\Users\xxxxx\Documents\PythonDevProgramme\MnesisProject\main5.py", line 306, in save_citation combo_auteur.delete(0, Tk.END) AttributeError: type object 'Tk' has no attribute 'END'my function :
def save_citation(citation_auteur, citation_theme, citation_citation, citation_reference): try: connection = sqlite3.connect('mnesis.db') cursor = connection.cursor() #création variable new_citation req = "INSERT INTO tb_citation( citation_auteur, citation_theme, citation_citation, citation_reference) VALUES ('"+citation_auteur+"','"+citation_theme+"', '"+citation_citation+"', '"+citation_reference+"')" cursor.execute(req) except Exception as e: print("ERREUR",e) connection.rollback() finally: cursor.close() connection.commit() connection.close() # Delete textbox after records combo_auteur.delete(0, Tk.END) combo_theme.delete(0, Tk.END) entry_citation.delete('1.0', END) entry_verset.delete('1.0', END) entry_ref.delete('1.0', END)