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


Python Event.process_event方法代码示例

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


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

示例1: initial_jobs

# 需要导入模块: from event import Event [as 别名]
# 或者: from event.Event import process_event [as 别名]
	def initial_jobs(self):
		while True:
			json_str=self.json_file.readline()
			if not json_str:
				break
			elif not json_str.startswith("{"):
				continue
			else:
				json_dict = json.loads(json_str)
				event = Event(json_dict)
				event.process_event(self.job)

		return 1
开发者ID:yncxcw,项目名称:yarnanalog,代码行数:15,代码来源:tracebuild_draw.py

示例2: input

# 需要导入模块: from event import Event [as 别名]
# 或者: from event.Event import process_event [as 别名]
from study import Study
from atmosphere import Athomosphere
from assignment import Assignment
import random

coffee_input = input('"Are we out of coffee?" - giving a meany look to Humen: ')
CodecoolClass.coffee_status = True if coffee_input == "n" else False
codecool_bp = CodecoolClass.generate_local()
codecool_bp.sum_stats("morning")
input("")
print("A typical day @Codecool starts with a mentors' discussion about that week's assignment.")
input("")
# event mentor discussion
for i in codecool_bp.mentors:
    event = Event(random.randint(-3, 4), "{0} is attending the meeting. Energy level: ".format(i.full_name))
    i.process(event.process_event())
codecool_bp.drink_coffee(50)
input("")
print("One of the mentors gets appointed to be responsible for the week's project: ")
# event "This week ..... mentor got appointed. Hooraaay!"
# appointing mentor of the week
codecool_bp.appoint_mentor()
active_mentor = next(i for i in codecool_bp.mentors if i.responsible)
input("")
print('''It's 8.40 and the office is almost empty.
Oh, wait, I can see someone drinking their morning coffee in the kitchen.
The students start to arrive very very slowly. Soothing music is playing in the background.''')
input("")
print("9 o'clock - GONG!")
input("")
print("Who's here already? Let's check the attendance!")
开发者ID:CodecoolBP20161,项目名称:a-mentor-s-life-in-an-oo-way-technocoolrapid,代码行数:33,代码来源:story.py


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