Cant import random module to Python

You would first have to define a path to IronPython’s librar, append it to the system path and then finally import the module.

pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)
import random

#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN

#Assign your output to the OUT variable.
OUT = random.random()

Works as expected:

5 Likes