Importing random module in Python Script


#1

In IronPython Console “import random” works. But I couldn’t manage to import it in Python Script.

Is there a way to do it? Thanks in advance…
random randomError


#2

import sys
sys.path.append(“C:\Program Files (x86)\IronPython 2.7\Lib”)
import random

 

does the trick!


#3

you have to add the path to your random.py library.

something like:

sys.path.append("/where_python _resides/lib")