コード例 #1
0
ファイル: system.py プロジェクト: AlanYang99/Online-Ordering
 def adddrinks(name, price, amount):
     infile = open("drinks", 'rb')
     inventory = pickle.load(infile)
     infile.close()
     inventory.append(Food(name, price, amount))
     outfile = open("drinks", "wb")
     pickle.dump(inventory, outfile)
     outfile.close()
コード例 #2
0
ファイル: system.py プロジェクト: AlanYang99/Online-Ordering
 def addburgerIngredients(name, price, amount):
     infile = open("burgerIngredients", 'rb')
     inventory = pickle.load(infile)
     infile.close()
     inventory.append(Food(name, price, amount))
     outfile = open("burgerIngredients", "wb")
     pickle.dump(inventory, outfile)
     outfile.close()
コード例 #3
0
ファイル: mains2.py プロジェクト: AlanYang99/Online-Ordering
 def set_drinks(self,drink,amount):
     found = 0
     infile = open("drinks", "rb")
     drinks = pickle.load(infile)
     infile.close()
     for i in drinks:
         if(i._name == drink):
             self._drinks.append(Food(i._name, i._price, amount))
             found = 1
             break
     if(found == 0):
         print("Drink is not found")
コード例 #4
0
ファイル: mains2.py プロジェクト: AlanYang99/Online-Ordering
 def set_wrapIngredients(self,wrapIngredient,amount):
     found = 0
     infile = open("wrapIngredients", "rb")
     wrapIngredients = pickle.load(infile)
     infile.close()
     for i in wrapIngredients:
         if(i._name == wrapIngredient):
             self._wrapIngredients.append(Food(i._name, i._price, amount))
             found = 1
             break
     if(found == 0):
         print("Ingredient is not found")
コード例 #5
0
ファイル: mains2.py プロジェクト: AlanYang99/Online-Ordering
 def set_sides(self,side,amount):
     found = 0
     infile = open("sides", "rb")
     sides = pickle.load(infile)
     infile.close()
     for i in sides:
         if(i._name == side):
             self._sides.append(Food(i._name, i._price, amount))
             found = 1
             break
     if(found == 0):
         print("Side is not found")