python can't use random function!

why the python script cant't use the random function。and how to import the py module? i suggest SS must have the function of python random.Tansks!

As of screen-scraper 5.0.7a

As of screen-scraper 5.0.7a the embedded python in screen-scraper is Jython 2.5.1, and you should be able to use any python module supported by Jython (including 'random' :)

You'll need to make sure the "Allow upgrading to unstable versions" box is checked in screen-scraper's settings dialog box, then select "Options" -> "Check for updates" from the menu to get the update.


missing random module

Screenscraper uses an embedded version of Jython to execute python scripts. The "random" module is part of the standard library that ships with Jython, but Screen-scraper doesn't ship that library (currently).

As a work-around you can install jython and libraries separately (see, and add the library to the script's search path. For example, if you install Jython in C:\jython, put this in your script:

import sys
if "C:\\jython\\Lib" not in sys.path:
import random

See for more on the python search path and importing modules.

We will likely do an alpha release soon which includes the standard library, and you won't need the above work-around.

lisihong, Thank you for


Thank you for bringing this to our attention. We are looking into the matter and will let you know when we have a solution.