Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sqlite3 as sq
- connect = sq.connect('Food_Data.db')
- con = connect.cursor()
- sql = ("SELECT Users_Food.Barcode, Users_Food.Item, Recipe1.Ham_Swiss_Omelet FROM Users_Food INNER JOIN Recipe1 ON Users_Food.Barcode = Recipe1.Barcode WHERE Recipe1.Ham_Swiss_Omelet = '1'")
- con.execute(sql)
- data = con.fetchall()
- print("You can make: Ham Swiss Omelet")
- formatted_row = '{:<10} {:<9} {:>9} '
- print(formatted_row.format("Barcode", "Ingredients", "Availability"))
- for row in data:
- print(formatted_row.format(*row))
- #print (row[:])
- #connect.commit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement