View Single Post
  #2  
Old 06-29-2011, 05:04 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,461
You can use the random.choice command:
Code:
import viz
import viztask
import random

viz.go()

def MyTask():
	
	while True:
		randomTime = random.choice([0.25,0.5,0.75])
		yield viztask.waitTime(randomTime)
		print randomTime,'seconds elapsed'

viztask.schedule( MyTask() )
Reply With Quote