python maintain two different random instance.
<p>I am trying to do some anaylsis and for 'reasons' I want objects in my programm to each have their own seeds but no global seeds. Can I accomplish something like this ? </p>

<pre><code>a = random.seed(seed1) 
b = random.seed(seed2)

for a in range(5) :
    print a.random() b.random()
</code></pre>

<p>The expect output would be </p>

<pre><code>0.23 0.23 
0.45 0.45 
0.56 0.56 
0.34 0.34 
</code></pre>

<p>etc... 
Obviously a super contrived example -- These separate seed will be buried in objects and correspond to specific things. But first step is getting something like this to work.</p>

<p>How can I have python maintain multiple seeded randoms ? </p>

<p>Then, this may help you:</p>

<pre><code>&gt;&gt;&gt; for _ in range(5): 
          rn=random.randint(1,100) 
          print(rn, rn) 
</code></pre>

<p>Output is:<br>
38 38 </p>

<p>98 98 </p>

<p>8 8 </p>

<p>29 29 </p>

<p>67 67</p>

python