On Mar 19, 11:57 am, NZach <nickzachara...@gmail.com> wrote: > The problem is that i am executing the main() function in lines 83 and 90, > but > i do not receive the same result, although the random seed is used in the G > class. > > Any idea please, how can i solve it ?
The seed is used to create a Random instance at the very start of the module. This means it will have the same state for each run of the module, but not for each execution of the main function. To have each execution of main() return the same result, you will need to set the seed _within_ the main function. Try adding this as the first line in main: G.Rnd = Random(12345) This should ensure that the state of your random generator is the same for each execution of the main() function and any subsequent functions it calls that rely on G.Rnd. -- http://mail.python.org/mailman/listinfo/python-list