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

Function search_button

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

Source from the content-addressed store, hash-verified

112
113
114def search_button(p1):
115 global cursor
116 global results
117 global index
118 w.errorOutput.configure(text="")
119 sql_command = """ SELECT * FROM notes WHERE title LIKE "%{0}%";"""
120 sql_command = sql_command.format(w.inputSearchTitle.get())
121 try:
122 cursor.execute(sql_command)
123 results = cursor.fetchall()
124 w.errorOutput.configure(text=str(len(results)) + " results")
125 index = 0
126 if index >= 0 and index < len(results):
127 w.outputNotice.delete(1.0, END)
128 w.outputNotice.insert(1.0, results[index][2])
129 except:
130 w.errorOutput.configure(text="Please create at first a database.")
131
132
133def next_button(p1):

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
deleteMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected