Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sqlite3
- mydatabase="F:\Labelmaker\skudb.db"
- connection = sqlite3.connect(mydatabase)
- with connection:
- connection.row_factory = sqlite3.Row
- cursor = connection.cursor()
- listofskus = ("ZI01","WT405","WL011")
- sql = 'select * from products where SKU in %s' % str(tuple(listofskus))
- cursor.execute(sql)
- allresults = cursor.fetchall()
- for x in allresults:
- print "SKU: " + str(x["SKU"]) + " VENDOR: " + str(x["vendor"]) + " MSRP: " + str(x["MSRP"]) + " Retail: " + str(x["Retail"]) + " Barcode: " + str(x["barcode"])
Add Comment
Please, Sign In to add comment