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


Groups > comp.lang.python > #4354

how to do random / SystemRandom switch

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail
From Matthias Kievernagel <mkiever@Pirx.sirius.org>
Newsgroups comp.lang.python
Subject how to do random / SystemRandom switch
Date Sat, 30 Apr 2011 09:10:30 +0000 (UTC)
Organization Aioe.org NNTP Server
Lines 23
Message-ID <ipgjm6$kdv$1@speranza.aioe.org> (permalink)
NNTP-Posting-Host 64lgluVpOUrep19B1JyNDw.user.speranza.aioe.org
X-Complaints-To abuse@aioe.org
User-Agent tin/1.9.3-20080506 ("Dalintober") (UNIX) (Linux/2.6.26-2-686 (i686))
X-Notice Filtered by postfilter v. 0.8.2
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:4354

Show key headers only | 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