当前位置: 首页>>代码示例>>Python>>正文


Python Manager.takeOrder方法代码示例

本文整理汇总了Python中Manager.Manager.takeOrder方法的典型用法代码示例。如果您正苦于以下问题:Python Manager.takeOrder方法的具体用法?Python Manager.takeOrder怎么用?Python Manager.takeOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Manager.Manager的用法示例。


在下文中一共展示了Manager.takeOrder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: selectOptions

# 需要导入模块: from Manager import Manager [as 别名]
# 或者: from Manager.Manager import takeOrder [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()
开发者ID:raghavs1108,项目名称:OOMDProject,代码行数:32,代码来源:Pharmacy.py


注:本文中的Manager.Manager.takeOrder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。