Python Forum
Unknown syntax error (Im new to this)
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unknown syntax error (Im new to this)
#1
# im trying to make a password cracker but i have a syntax error. the problem is in line 15 im not sure how to fix it.
# i believe it's a problem with the speech marks. any help?? thx!!
import md5 counter = 1 pass_in = raw_input("Enter MD5 Hash: ") pwfile = raw_input("Please enter the dictionary attack file name: ") try: pwfile = open(pwfile, "r") except:	print ("\nFile not found.")	quit() for password in pwfile:	filemd5 = md5.new(password.strip()).hexidigest() print "Trying password number %d: %s " % (counter, password.strip())	counter += 1	if pass_in == filemd5:	print "\nMatch found. \nPassword is: %s" % password	break else: print "\Failed. Password not found."
Reply
#2
If you're actually getting a SyntaxError on line 15, you're trying to run python 2 code using python 3.
If you were running it using python 2, you'd get an IndentationError on line 16 instead.

So you'll need to either use python 2, or rewrite your code for python 3.
Reply
#3
ok thank you very much Heart
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  POST Syntax error amplay 0 1,300 Aug-07-2024, 02:43 PM
Last Post: amplay
  is this really a syntax error? Skaperen 4 2,511 May-25-2024, 07:31 AM
Last Post: snippsat
  World Clock syntax error OscarBoots 1 1,731 May-03-2024, 05:20 AM
Last Post: snippsat
  Syntax error for "root = Tk()" dlwaddel 15 10,423 Jan-29-2024, 12:07 AM
Last Post: dlwaddel
Photo SYNTAX ERROR Yannko 3 2,037 Jan-19-2024, 01:20 PM
Last Post: rob101
  Syntax error while executing the Python code in Linux DivAsh 8 8,470 Jul-19-2023, 06:27 PM
Last Post: Lahearle
  Error UserWarning: Unknown option ssl_ca_certs warnings.warn(str(exc)) Vijayaraj 0 1,758 Jul-11-2023, 06:01 AM
Last Post: Vijayaraj
  Code is returning the incorrect values. syntax error 007sonic 6 4,148 Jun-19-2023, 03:35 AM
Last Post: 007sonic
  syntax error question - string mgallotti 5 3,595 Feb-03-2023, 05:10 PM
Last Post: mgallotti
  Syntax error? I don't see it KenHorse 4 3,772 Jan-15-2023, 07:49 PM
Last Post: Gribouillis

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020
This forum uses Lukasz Tkacz MyBB addons.
Forum use Krzysztof "Supryk" Supryczynski addons.