So I wanted to create code that creates fake steam keys/adobe keys to fool my friends into thinking I can get as many games as I want. So I got everything working as planned, the code generates the steam key and then places it into a .txt file.
However I find it very annoying that I need to keep manually reopening the file after every time I type "y" in the if another == "y":
line to access the new key. I was wondering if it is possible to have it open the .txt file for me. I have looked through many websites and can't find anything that actually launches the .txt. Hope someone can help me out here, full code is as follows:
import string
import subprocess
import sys
import random
from random import *
while True:
def steam():
while True:
min_char = 5
max_char = 5
allchar = string.ascii_letters + string.digits
password1 = str("".join(choice(allchar) for x in range(randint(min_char, max_char))))
password2 = str("".join(choice(allchar) for x in range(randint(min_char, max_char))))
password3 = str("".join(choice(allchar) for x in range(randint(min_char, max_char))))
f = open('Steam Keygen.txt','w')
f.write(password1.upper() + "-" + password2.upper() + "-" + password3.upper())
f.close()
steampath = r'C:\Users\mynamewhichIdontwanttoshare\Desktop\Steam Keygen.txt'
subprocess.Popen(",s ,s" , (steampath))
another = input("Another?")
if another == "y":
print("Ok!")
steam()
else:
sys.exit(0)
def first():
watchuwant = input("What software do you want a code for?")
if watchuwant == "steam":
steam()
elif watchuwant == "adobe":
adobe()
else:
print("This is not available, sorry.")
first()
Note:
The adobe()
function doesn't work yet so if you want to run it, just test by typing:
-What software do you want a code for?
steam
-Another?
y