Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #4354

how to do random / SystemRandom switch

From Matthias Kievernagel <mkiever@Pirx.sirius.org>
Newsgroups comp.lang.python
Subject how to do random / SystemRandom switch
Date 2011-04-30 09:10 +0000
Organization Aioe.org NNTP Server
Message-ID <ipgjm6$kdv$1@speranza.aioe.org> (permalink)

Show all headers | View raw


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 similar thing in the Makefile using
Compiler-/Link-Options (DEBUG/FINAL Build) switching
between two libraries.

Any hints are welcome, especially a search term
would be very helpful :)

Thanks in advance,
Matthias Kievernagel.

Back to comp.lang.python | Previous | Next | Find similar


Thread

how to do random / SystemRandom switch Matthias Kievernagel <mkiever@Pirx.sirius.org> - 2011-04-30 09:10 +0000

csiph-web