Created
December 3, 2014 12:09
-
-
Save jonaslsaa/070ff2b913f696491b95 to your computer and use it in GitHub Desktop.
Never the same number generator. VERSION 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random as rnd | |
nu=0 | |
try: | |
with open("DATA.txt", 'r') as f: | |
c = [line.rstrip('\n') for line in f] | |
print "LOADED!" | |
except IOError: | |
print "Setting up!" | |
with open("DATA.txt", 'w') as f: | |
print "LOADED!" | |
while nu == 0: | |
check=rnd.randint(1000,9999) | |
with open("DATA.txt", 'r') as f: | |
c = [line.rstrip('\n') for line in f] | |
if str(check) in c: | |
print "NEXT" | |
else: | |
with open("DATA.txt", 'a') as f: | |
f.write(str(check)+'\n') | |
raw_input("Press Enter to show Key! ") | |
print "\n\n\n\nYour Key: " + str(check) | |
nu=1 | |
dummie = raw_input() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment