python - My program comes back with either "Unexpected EOF while parsing" or "Expected indented block" both as syntax errors -
here small terminal-style program had been working on, stopped because of issues code.(written in python 3.4.1) this?
import time import sys import os #this next part restarts program in case of invalid user/pass combination def restart_program(): python = sys.executable os.execl(python, python, * sys.argv) #definitions of strings in lists h = 'h' d = 'd' ma = 'ma' me = 'me' c = 'c' = 'a' l = 'l' yes = 'yes' no = 'no' y = 'yes' n = 'no' yes = 'yes' no = 'no' yes = 'yes' no = 'no' yes = 'yes' no = 'no' yes = 'yes' yes = 'yes' yes = 'yes' yes = 'yes' #string lists varlist1 = [d,ma,me,c,a,l,h] yes = [yes,y,yes,yes,yes,yes,yes,yes,yes] no = [no,n,no,no,no] admin = 'admin' deerfield = 'deerfield' password = 'password' cmenasco = 'cmenasco' cyape = 'cyape' guest = 'guest' userlist = [cmenasco,cyape,guest] passlist = [admin,deerfield,password] print('booting up.....') print('...............') print('...............') print('') print('') print('-----login-----') tempuser = input('username: ') temppassword = input('password: ') if tempuser == cmenasco: if temppassword == admin: print('welcome-christian-') print('------------------') time.sleep(2.5) print('*-------------------------------------------*') print('| welcome samnet v1.0! |') print('| (type in catagory view) |') print('| -documents(d)-| |') print('| -mail(ma)-| |') print('| -messages(me)-| |') print('| -classified(c)-| |') print('| -accountinfo(a)-| |') print('| -logout(l)-| |') print('| -help(h)-| |') print('| |') print('| c.2013 |') print('*-------------------------------------------*') var1 = input('press key continue: ') #documents if var1 == d: print('*------------------------------------------*') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('*------------------------------------------*') #mail elif var1 == ma: print('*------------------------------------------*') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('*------------------------------------------*') #messages elif var1 == me: print('*------------------------------------------*') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('*------------------------------------------*') #classified elif var1 == c: print('*------------------------------------------*') print('| |') print('| 1. report22.txt |') print('| 2. introd.txt |') print('| 3. mason.txt |') print('| 4. recent_inves.txt |') print('| 5. information/about.txt |') print('| 6. recent_events(rus_com) |') print('| 7. support |') print('| |') print('| |') print('| |') print('*------------------------------------------*') #account info elif var1 == a: print('*------------------------------------------*') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('*------------------------------------------*') #help elif var1 == h: print('*------------------------------------------*') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('| |') print('*------------------------------------------*') #logout elif var1 == l: print('*------------------------------------------*') print('| samnet-path/user-cmenasco |') print('| |') print('| want logout? |') print('| |') print('| |') print('|******************************************|') print('| warning! |') print('|if logout, session terminated!|') print('|******************************************|') print('| |') print('| |') print('*------------------------------------------*') respondyn = input('(yes/no) ') if respondyn == yes: restart_program() elif respondyn == no: #make pages each link # elif var1
this problem- says there "expected indent" or "unexpected eof while parsing" -this rest of unfinished program-
elif tempuser == cyape if temppassword == deerfield print('success') if tempuser == guest: if temppassword == password: print('success') if tempuser not userlist or temppassword not passlist: print('incorrect password/username combination') if tempuser not userlist or temppassword not passlist: restart_program()
elif , if missing colons
elif tempuser == cyape: if temppassword == deerfield: print('success')
Comments
Post a Comment