[IPython-dev] [FWD] An interesting take on the Notebook Problem

Hans Meine hans_meine at gmx.net
Mon Aug 1 07:53:42 CDT 2005


On Friday 22 July 2005 16:05, Toni Alatalo wrote:
> [...] quick Googling now didn't tell me if the Python
> random generator is guaranteed to give the same results with the same
> seed and in what conditions (i know from working on procedural modelling
> that it at least works on the same computer..), but that can be looked
> at later.

Confusingly, calling "random.seed(...)" is not enough.  A too quick check once 
gave me the impression that it was (the first call of random.random() indeed 
returned the same value), but in order to store/restore the complete state 
you need to use the provided functions random.getstate() and 
random.setstate() which return the state as a a 3-tuple of an int, a tuple 
containing 625 ints and a None here.

Greetings,
   Hans




More information about the IPython-dev mailing list