Right. Basically I'm new to Python ( Go on call me a noob) and I'm trying to make a program that will open certain programs when you give the right password. But i just can't seem to get it to open the right files. So far, I am only trying it out on Mozilla Firefox and Nmap - Zenmap GUI. here's the code if you want to see it:
------------------------------------------------------------------------------
def get_password():
for k in range(1):
encoded = "sqrMHtl8"
password = raw_input("Enter your password: ")
if password == encoded.encode('rot13'):
return True
return False
def start():
if get_password():
print "Success!"
def menu():
print "Welcome to Program Selector"
print "Your Options are: "
print " "
print "1. Mozilla Firefox"
print "2. Nmap - Zenmap GUI"
print "3. Exit this program"
print " "
return input ("Choose your program: ")
loop = 1
choice = 0
while loop == 1:
choice = menu()
if choice == 1:
import os
os.system("cd \..\Program Files\Mozilla Firefox\ Start firefox.exe")
loop = 0
elif choice == 2:
import os
os.system("cd \..\Program Files\Nmap\zenmap\ START zenmap.exe")
loop = 0
elif choice == 3:
loop = 0
else:
print "Wrong password!"
if __name__ == "__main__":
start()