jaclyn.bill
09-09-2009, 03:30 AM
I'm having some issues using random.choice which seem like a bug.
At the top of my script I have imported random and other random options are working in the script (e.g. random.uniform). However random choice keeps resulting in the error
'module' object has no attribute 'choice'
this is my code...
def createpath():
Side_select = ([5.0,-5.0])
XEXTENT = random.choice(Side_select) ### furthest extent of road
XRANDOM = random.uniform(0.0,1.5) ###
ZCOORD = linspace(0.0, METERS,POINTS) #### z coords 0 - meters
XCOORD = cos(ZCOORD/18.0)*XEXTENT*sin(ZCOORD/10.0)*XRANDOM
The strange issue is that when I start a fresh vizard file with just bottom five lines random.choice works.
Anyone have any ideas why this might be? I really need this to work within the context of my whole script.
At the top of my script I have imported random and other random options are working in the script (e.g. random.uniform). However random choice keeps resulting in the error
'module' object has no attribute 'choice'
this is my code...
def createpath():
Side_select = ([5.0,-5.0])
XEXTENT = random.choice(Side_select) ### furthest extent of road
XRANDOM = random.uniform(0.0,1.5) ###
ZCOORD = linspace(0.0, METERS,POINTS) #### z coords 0 - meters
XCOORD = cos(ZCOORD/18.0)*XEXTENT*sin(ZCOORD/10.0)*XRANDOM
The strange issue is that when I start a fresh vizard file with just bottom five lines random.choice works.
Anyone have any ideas why this might be? I really need this to work within the context of my whole script.