本文整理汇总了Python中scene.Scene.removeAllWorkers方法的典型用法代码示例。如果您正苦于以下问题:Python Scene.removeAllWorkers方法的具体用法?Python Scene.removeAllWorkers怎么用?Python Scene.removeAllWorkers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scene.Scene
的用法示例。
在下文中一共展示了Scene.removeAllWorkers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import removeAllWorkers [as 别名]
def main():
scene = Scene()
running = True
showHelp()
while True:
sys.stdout.write("#>")
s = sys.stdin.readline()
items = s.split()
if(len(items)<1):
print "Invalid format:"
showHelp()
continue
#if(items[0]=="exit"):
# myscene = display.get_selected()
# myscene.visible=False
# myscene.withdraw()
elif(items[0]=="help"):
showHelp()
print ""
elif(items[0]=="add"):
if(len(items)<7):
print "Invalid format:"
showHelp()
continue
newcolor = color.red
if(items[1]=="red"):
newcolor = color.red
elif(items[1]=="green"):
newcolor = color.green
elif(items[1]=="yellow"):
newcolor = color.yellow
elif(items[1]=="blue"):
newcolor = color.blue
newrad = int(items[2])
newcount = int(items[3])
newscript = str(items[4])
newinterval = int(items[5])
newtitle = str(items[6])
#newtail = str(items[6])
#tail = False
#if(newtail=="tail"):
# tail = True
for i in range(0,newcount):
scene.addWorker(newcolor,newrad,newscript,newinterval,newtitle)
elif(items[0]=="remove"):
title=str(items[1])
if(title=="*"):
scene.removeAllWorkers()
else:
scene.removeWorker(title)
print ""
elif(items[0]=="incr" or items[0]=="decr"):
if(len(items)<4):
print "Invalid format:"
showHelp()
continue
if(items[2]=="x"):
if(items[1]=="*"):
if(items[0]=="incr"):
scene.incAllWorkerMeanX(int(items[3]))
elif(items[0]=="decr"):
scene.incAllWorkerMeanX(-int(items[3]))
else:
if(items[0]=="incr"):
scene.incWorkerMeanX(str(items[1]),int(items[3]))
elif(items[0]=="decr"):
scene.incWorkerMeanX(str(items[1]),-int(items[3]))
elif(items[2]=="y"):
if(items[1]=="*"):
if(items[0]=="incr"):
scene.incAllWorkerMeanY(int(items[3]))
elif(items[0]=="decr"):
scene.incAllWorkerMeanY(-int(items[3]))
else:
if(items[0]=="incr"):
scene.incWorkerMeanY(str(items[1]),int(items[3]))
elif(items[0]=="decr"):
scene.incWorkerMeanY(str(items[1]),-int(items[3]))
elif(items[2]=="z"):
if(items[1]=="*"):
if(items[0]=="incr"):
scene.incAllWorkerMeanZ(int(items[3]))
elif(items[0]=="decr"):
#.........这里部分代码省略.........