Re: how to do random / SystemRandom switch

2011-04-30 Thread Matthias Kievernagel
Peter Otten <__pete...@web.de> wrote: > Matthias Kievernagel wrote: > >> In my top-level script I want to select if my program >> is to use random.xxx functions or the random.SystemRandom.xxx >> ones. All the other modules shouldn't know about that >> switch and simply use >> import random >> ...

Re: how to do random / SystemRandom switch

2011-04-30 Thread Peter Otten
Matthias Kievernagel wrote: > In my top-level script I want to select if my program > is to use random.xxx functions or the random.SystemRandom.xxx > ones. All the other modules shouldn't know about that > switch and simply use > import random > ... > return random.randint(1, 6) > ... > for exampl

Re: how to do random / SystemRandom switch

2011-04-30 Thread Thomas Rachel
Am 30.04.2011 11:10 schrieb Matthias Kievernagel: In my top-level script I want to select if my program is to use random.xxx functions or the random.SystemRandom.xxx ones. On which criteria do you fix that? Anyway, you could use a module myrandom.py: import random if use_sys: randobj =

how to do random / SystemRandom switch

2011-04-30 Thread Matthias Kievernagel
Dear list, In my top-level script I want to select if my program is to use random.xxx functions or the random.SystemRandom.xxx ones. All the other modules shouldn't know about that switch and simply use import random ... return random.randint(1, 6) ... for example. In C I would do a simil