本文整理汇总了Python中Manager.Manager.displayInventory方法的典型用法代码示例。如果您正苦于以下问题:Python Manager.displayInventory方法的具体用法?Python Manager.displayInventory怎么用?Python Manager.displayInventory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manager.Manager
的用法示例。
在下文中一共展示了Manager.displayInventory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: selectOptions
# 需要导入模块: from Manager import Manager [as 别名]
# 或者: from Manager.Manager import displayInventory [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()