| 68 | |
| 69 | |
| 70 | def add_button(p1): |
| 71 | # for manipulating the data base |
| 72 | global cursor |
| 73 | global connection |
| 74 | if len(w.inputTitle.get()) > 0 and len(w.inputNotice.get(1.0, END)) > 0: |
| 75 | w.errorOutput.configure(text="") |
| 76 | title = w.inputTitle.get() |
| 77 | note = w.inputNotice.get(1.0, END) |
| 78 | sql_command = """INSERT INTO notes (title,note) VALUES ("{0}","{1}"); """ |
| 79 | sql_command = sql_command.format(title, note) |
| 80 | cursor.execute(sql_command) |
| 81 | connection.commit() |
| 82 | else: |
| 83 | w.errorOutput.configure(text="Please fill the fields. ") |
| 84 | |
| 85 | |
| 86 | def back_button(p1): |