Last active
December 8, 2017 13:50
-
-
Save BlogBlocks/f9803ed3c1e5cce78eeb116baf7a0629 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def dbread(): | |
| import sqlite3 | |
| conn = sqlite3.connect('XPfts4.db') | |
| c = conn.cursor() | |
| count = 0 | |
| req = 100 | |
| view = raw_input("Search : ") | |
| for row in c.execute('SELECT rowid, code FROM pages WHERE pages MATCH ?', (view,)): | |
| count=count+1 | |
| print (row)[0],"-",(row)[1],"\n" | |
| if count > req: | |
| conn.close() | |
| sys.exit() |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use to do a quick DB read with raw_input