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


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