On 07/07/14 00:28, Alan Gauld wrote:
Drop the else clause and put the try/except inside a while...
def makelgpwdcombs(brutelistname):
while True:
try:
blst = open(brutelistname, 'r')
break # exit loop if no error
oops, indentation error there. Sorry
while True:
try:
blst = open(brutelistname, 'r')
break # exit loop if no error
except:
print("[-] Invalid file name or insufficient priviliges")
print("[+] File opened. Working...") # only after valid input
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor