本文整理匯總了Python中Manager.Manager.itemList方法的典型用法代碼示例。如果您正苦於以下問題:Python Manager.itemList方法的具體用法?Python Manager.itemList怎麽用?Python Manager.itemList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Manager.Manager
的用法示例。
在下文中一共展示了Manager.itemList方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: selectOptions
# 需要導入模塊: from Manager import Manager [as 別名]
# 或者: from Manager.Manager import itemList [as 別名]
class Inventory:
option = 0
def selectOptions(self):
print("press 1 to purchase:")
print("press 2 to return:")
print("press 3 to display Inventory:")
return int(raw_input())
def __init__(self):
self.manager = Manager()
self.cashier = Cashier()
flag = True
while flag:
self.option = self.selectOptions()
if self.option == 1:
self.client_id = random.randint(1, 1000)
self.manager.itemList()
orderDetails = self.manager.takeOrder(self.client_id)
if orderDetails[0] == "checkout":
self.cashier.checkout(orderDetails[1])
self.manager.displayInventory()
elif orderDetails[0] == "don't checkout":
print("we have ordered the requested items right away! please wait for us to get back to you.")
elif self.option ==2:
self.manager.close()
self.cashier.close()
flag = False
sys.exit(0)
elif self.option == 3:
self.manager.displayInventory()