Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import sqlite3 as sq
  2.  
  3.  
  4. connect = sq.connect('Food_Data.db')
  5. con = connect.cursor()
  6.  
  7. 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'")
  8. con.execute(sql)
  9. data = con.fetchall()
  10. print("You can make: Ham Swiss Omelet")
  11. formatted_row = '{:<10} {:<9} {:>9} '
  12. print(formatted_row.format("Barcode", "Ingredients", "Availability"))
  13. for row in data:
  14. print(formatted_row.format(*row))
  15. #print (row[:])
  16. #connect.commit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement