Seeding the rand() Generator

Fred Atkinson fatkinson at mishmash.com
Sun Aug 2 17:18:28 EDT 2009


On Sun, 02 Aug 2009 08:53:50 -0700, Scott David Daniels
<Scott.Daniels at Acm.Org> wrote:

>Fred Atkinson wrote:
>> 	How does one seed the rand() generator when retrieving random
>> recordings in MySQL?  
>
>It is not entirely clear what you are asking.  If you are talking about
>MySQL's random number generator, you are talking in the wrong newsgroup.
>If you are talking about Python's, does this work?
>     import random
>     random.seed(123542552)
>I'm not quite sure how you came to believe that Python controls MySQL,
>as opposed to using its services.
>
>--Scott David Daniels
>Scott.Daniels at Acm.Org

	I am coding in Python.  

	I am accessing a MySQL database.  

	I have a string to instruct the MySQL database to use the
'rand()' function to randomly choose one of the records in the
database.  

	I know how to seed it in PHP.  Does anyone know how to see it
from with Python?  

	Regards, 




						Fred 



More information about the Python-list mailing list