我想每隔\uuuuu秒调用一次printFunction方法,但我想在一定次数的调用之后停止调度。例如,每5秒打印10次。从另一个文件中提取这些频率和运行时值。你知道吗
穿着紧身衣跑步。你知道吗
导入计划 导入时间
课程示例:
# basic function to print
def printFunction(self):
print("Hello world")
def repeated(self):
# reads in two values from another file
systemFrequency = float(freqSettings.systemFrequency)
systemRunTime = int(freqSettings.systemRunTime)
global count
count = 0
while (count < systemRunTime):
self.printFunction
self.increaseCount
def increaseCount(self):
global count
count += 1
调度程序运行的函数需要返回CancelJob以停止调度。你知道吗
我是这样实现的:
显示10个“你好世界”
相关问题 更多 >
编程相关推荐