Random module problems
Posted: Thu Jan 23, 2014 5:44 pm
I was trying to use some random module functions and something seems very wrong.
I ran a brief program to check the first bit before actually executing any random statements. and something wasn't right. Without going through the whole diagnosis, it seems that just doing the "import random" command the program prints out whatever it has previously printed before running the program. It even manages to do this after its been rebooted or turned off. It does it regardless of whether its being run from geany or a command line, or whether or not I write a new program.
If I put in
random.sample (1,2,3),1)
it says attribute doesn't exist
If I put in
random.random()
it says attribute not callable
Any clues, what is going on here or how I fix it?
I ran a brief program to check the first bit before actually executing any random statements. and something wasn't right. Without going through the whole diagnosis, it seems that just doing the "import random" command the program prints out whatever it has previously printed before running the program. It even manages to do this after its been rebooted or turned off. It does it regardless of whether its being run from geany or a command line, or whether or not I write a new program.
If I put in
random.sample (1,2,3),1)
it says attribute doesn't exist
If I put in
random.random()
it says attribute not callable
Any clues, what is going on here or how I fix it?