Re: I can't import random module


javierfernandezc@...
 
Edited

Finally, I have chosen to make my own random choice function instead:

def RandomChoice(list):

    secondsMII = int((datetime.utcnow() - datetime(2000, 1, 1)).total_seconds() * 1000)

    randomIndex = secondsMII % len(list)

    return list[randomIndex]

Join users@ironpython.groups.io to automatically receive all group messages.