RE: Random module missing?

2009-09-23 Thread Brown, Rodrick
: Random module missing? On Wed, Sep 23, 2009 at 5:00 PM, Brown, Rodrick wrote: > I seen some documentation about random.random() but my version seems to be > broken? > > Python 2.3.4 (#1, Jul 16 2009, 07:03:37) [GCC 3.4.6 20060404 (Red Hat > 3.4.6-11)] on linux2 Type "help&quo

Re: Random module missing?

2009-09-23 Thread Robert Kern
On 2009-09-23 16:00 PM, Brown, Rodrick wrote: I seen some documentation about random.random() but my version seems to be broken? Python 2.3.4 (#1, Jul 16 2009, 07:03:37) [GCC 3.4.6 20060404 (Red Hat 3.4.6-11)] on linux2 Type "help", "copyright", "credits" or "license" for more information. imp

Re: Random module missing?

2009-09-23 Thread Jerry Hill
On Wed, Sep 23, 2009 at 5:00 PM, Brown, Rodrick wrote: > I seen some documentation about random.random() but my version seems to be > broken? > > Python 2.3.4 (#1, Jul 16 2009, 07:03:37) > [GCC 3.4.6 20060404 (Red Hat 3.4.6-11)] on linux2 > Type "help", "copyright", "credits" or "license" for mor

Re: random module gives same results across all configurations?

2009-03-04 Thread Carl Banks
On Mar 4, 12:33 am, "Diez B. Roggisch" wrote: > > So far I get the same results under Mac OS X, Windows, and Linux > > (Google App Engine).  I'm particularly interested in getting the same > > results under the Google App Engine even as Google upgrades its > > servers over time. > > I just had a l

Re: random module gives same results across all configurations?

2009-03-04 Thread Diez B. Roggisch
Paul Rubin schrieb: "Diez B. Roggisch" writes: Random uses AFAIK rand/srand from the stdlib.h of your platform (*nix, no idea how that beast is called in redmond). According to http://docs.python.org/library/random.html it uses Mersenne Twister. Yeah, I figured that out later, sorry for th

Re: random module gives same results across all configurations?

2009-03-04 Thread Paul Rubin
"Diez B. Roggisch" writes: > Random uses AFAIK rand/srand from the stdlib.h of your platform (*nix, > no idea how that beast is called in redmond). According to http://docs.python.org/library/random.html it uses Mersenne Twister. -- http://mail.python.org/mailman/listinfo/python-list

Re: random module gives same results across all configurations?

2009-03-04 Thread Diez B. Roggisch
So far I get the same results under Mac OS X, Windows, and Linux (Google App Engine). I'm particularly interested in getting the same results under the Google App Engine even as Google upgrades its servers over time. I just had a look into the python source - and I was wrong, it appears rando

Re: random module gives same results across all configurations?

2009-03-03 Thread Amir Michail
On Mar 4, 2:26 am, "Diez B. Roggisch" wrote: > Amir Michail schrieb: > > > On Mar 3, 10:05 pm, Chris Rebert wrote: > >> On Tue, Mar 3, 2009 at 6:59 PM, Amir Michail wrote: > >>> Hi, > >>> Is it the case that the random module will always give the same > >>> results if given the same seed across

Re: random module gives same results across all configurations?

2009-03-03 Thread Diez B. Roggisch
Amir Michail schrieb: On Mar 3, 10:05 pm, Chris Rebert wrote: On Tue, Mar 3, 2009 at 6:59 PM, Amir Michail wrote: Hi, Is it the case that the random module will always give the same results if given the same seed across all configurations (e.g., architectures, compilers, etc.)? Your question

Re: random module gives same results across all configurations?

2009-03-03 Thread Carl Banks
On Mar 3, 6:59 pm, Amir Michail wrote: > Hi, > > Is it the case that the random module will always give the same > results if given the same seed across all configurations (e.g., > architectures, compilers, etc.)? If you need a repeatable sequence, such as for unit testing, you can subclass ran

Re: random module gives same results across all configurations?

2009-03-03 Thread Chris Rebert
On Tue, Mar 3, 2009 at 7:11 PM, Amir Michail wrote: > On Mar 3, 10:05 pm, Chris Rebert wrote: >> On Tue, Mar 3, 2009 at 6:59 PM, Amir Michail wrote: >> > Hi, >> >> > Is it the case that the random module will always give the same >> > results if given the same seed across all configurations (e.g

Re: random module gives same results across all configurations?

2009-03-03 Thread Amir Michail
On Mar 3, 10:05 pm, Chris Rebert wrote: > On Tue, Mar 3, 2009 at 6:59 PM, Amir Michail wrote: > > Hi, > > > Is it the case that the random module will always give the same > > results if given the same seed across all configurations (e.g., > > architectures, compilers, etc.)? > > Your question is

Re: random module gives same results across all configurations?

2009-03-03 Thread Chris Rebert
On Tue, Mar 3, 2009 at 6:59 PM, Amir Michail wrote: > Hi, > > Is it the case that the random module will always give the same > results if given the same seed across all configurations (e.g., > architectures, compilers, etc.)? Your question is vague. Define what you mean by "same results" in this

Re: random module

2006-10-29 Thread Fredrik Lundh
Moishy Gluck wrote: > I am using the random module to generate a session tracker. I use this > code to generate a random number "random.random() * 1" > The session is stored in a mysql database under the field session_id. > The problem is when I try to submit the random number i

Re: random module question

2005-06-07 Thread Raymond Hettinger
>> Is Mersenne Twister currently available at all in Jython, for example? Googling for "java mersenne twister" provides multiple hits including: http://www.axlradius.com/freestuff/Free.htm#MT Raymond -- http://mail.python.org/mailman/listinfo/python-list

Re: random module question

2005-06-06 Thread Roose
Raymond Hettinger wrote: > The answer is a qualified Yes. While the core generator (currently Thanks! That is the answer I'm looking for. And to Paul Rubin, it is a good point that Jython might not support it, but at this point it doesn't interest me. The program is only for myself anyway.

Re: random module question

2005-06-06 Thread Paul Rubin
"Raymond Hettinger" <[EMAIL PROTECTED]> writes: > >> Can I rely on the random.py module to produce the same series of > >> numbers for future/past versions of Python, given the same seed? > > The answer is a qualified Yes. While the core generator (currently the > Mersenne Twister algorithm) is s

Re: random module question

2005-06-06 Thread Raymond Hettinger
>> Can I rely on the random.py module to produce the same series of >> numbers for future/past versions of Python, given the same seed? The answer is a qualified Yes. While the core generator (currently the Mersenne Twister algorithm) is subject to change across versions, whenever we've updated t

Re: random module question

2005-06-05 Thread Paul Rubin
"Roose" <[EMAIL PROTECTED]> writes: > Can I rely on the random.py module to produce the same series of numbers for > future/past versions of Python, given the same seed? Can I rely on it > across different architectures and operating systems? > > I looked at the docs and couldn't find this stat