MCPcopy Create free account
hub / github.com/geekcomputers/Python / add_button

Function add_button

notepad/notepad_support.py:70–83  ·  view source on GitHub ↗
(p1)

Source from the content-addressed store, hash-verified

68
69
70def 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
86def back_button(p1):

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected