+ Reply to Thread
Results 1 to 4 of 4

Thread: Random process not working

  1. #1

    Random process not working

    Hi, trying to figure this out, the random() process is not working on my version? the error message 'Message: global name 'random' is not defined' comes back every time. Is there a collection I need to load or call in specific? Does anyone know how to fix this?

  2. #2
    Super Moderator Mitch's Avatar
    Join Date
    May 2010
    Location
    Switzerland
    Posts
    286
    Hi,
    Did you import the random module? It seems to be working here...
    --Mitch

  3. #3
    the random module does not even appear in the list of available modules? I checked the directory and there is a random.py file there but it seems like ironpython is not importing it or something like that?

  4. #4
    Super Moderator Mitch's Avatar
    Join Date
    May 2010
    Location
    Switzerland
    Posts
    286
    Is your installation non-standard? Here it works OK...
    python Code:
      import random
      number=random.random()
      print number
    You will not get the autocomplete for a lot of the modules in Python - there are almost 200 of them in the lib folder - so I assume only the most commonly used ones in Rhino have been put in there...

    If you cannot import random, then there must be something haywire with your install...
    --Mitch

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts