X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pickrand.py;h=6340971a6036e7bae1770e5901563926c65655bd;hb=9374e89eef8115bf1680585eb32ab11bb1942525;hp=558115c3f4b1a5841eb4990f7cc2ef0e4ef5757e;hpb=e13e85ec8efe1559b07193610a250836e031a8a2;p=cmccabe-bin diff --git a/pickrand.py b/pickrand.py index 558115c..6340971 100755 --- a/pickrand.py +++ b/pickrand.py @@ -20,7 +20,7 @@ for root, dirs, files in os.walk("."): allfiles.append(os.path.join(root, f)) if (len(allfiles) == 0): sys.exit(1) -random.seed(None) +random.seed(os.getpid()) r = random.randint(0,len(allfiles) - 1) print(allfiles[r]) if (print_to_stderr):