Tuesday, 20 August 2013

I get invalid syntax on this program I started

I get invalid syntax on this program I started

I started programming a few days ago and started this, a simple program
which will open a file if a passwor dis entered correctly. Whenever I run
I get syntax error. Please tell me where I have gone wrong :) import time
import sys import os
def Start():
passwordcount = 0
print("Hello There")
print("To get started, please enter your password")
print("If you forget your password, enter CLUE")
print("If you have never used this before, please press [N] then enter")
PasswordKnown()
def AuthComplete():
pass
def PWNK():
pwmake1 = input("Please enter a new password")
pwmake2 = input("Please re-enter your password")
if pwmake1 == pwmake2:
password_file = open('c:\\Documents and
Settings\Adam\Desktop\NewProgram\Resources\Launcher\pw.txt',
'w')
password_file.write(pwmake1)
password_file.close()
clue = input("Please enter a Password Clue")
clue_file = open('c:\\Documents and
Settings\Adam\Desktop\NewProgram\Resources\Launcher\clue.txt',
'w')
clue_file.write(clue)
print("Thank You very much...")
AuthComplete()
def PasswordKnown():
password_file = open('c:\\Documents and
Settings\Adam\Desktop\NewProgram\Resources\Launcher\pw.txt')
realpassword = password_file.read()
passwordg = input("Please enter your password")
if passwordg == realpassword:
print("Password Correct")
elif passwordg == 'CLUE':
clue_file = open ('c:\\Documents and
Settings\Adam\Desktop\NewProgram\Resources\Launcher\clue.txt')
pwclue = clue_file.read()
print(pwclue)
PasswordKnown()
elif passwordg == 'N':
PWNK()
elif passwordg != realpassword:
passwordcount = (passwordcount + 1)
print("That was incorrect. Please try again.")
elif passwordcount == 3 or >3:
print("Maximum password attempts reached. Sorry. :-)")
sys.close()
Start()

No comments:

Post a Comment