コード例 #1
0
	def run(self, dis):
		next_trick_time = 3
		while not self.should_exit:
			try:
				if CommandHelper.run("killall htop") == 0 or CommandHelper.run("killall top") == 0:
					Term.print_all("You tough that this will be as easy as this?\n")
					sa.WaveObject.from_wave_file("data/goose.wav").play()
				next_trick_time -= 1
				if next_trick_time <= 0:
					trick = Trick.get_random_trick(not dis)
					next_trick_time = trick.delay
					trick.run()
					if trick.is_reversible:
						self.tricks.append(trick)
				time.sleep(1)
			except KeyboardInterrupt:
				...