0

I am running the below and am getting the error. Can anyone help?

import feedparser, MySQLdb
db = MySQLdb.connect(host='localhost',user='root',passwd='passsswd’, db=‘no’)

ERROR:

 File "<ipython-input-6-0238cde77faf>", line 2
 db = MySQLdb.connect(host='localhost',user='root',passwd='passsswd’, db=‘no’)
^
SyntaxError: EOL while scanning string literal
asked Sep 10, 2019 at 20:16
1
  • If you are using an IDE, I suggest setting-up syntax highlighting. You'll immediately see that the format of the passwd= value stays the same until ), hinting that something's wrong, even before you run your code (similar to how the code looks like here in SO). Commented Sep 11, 2019 at 4:26

1 Answer 1

1

You're using and instead of ', which confuses the interpreter. Just replace all instances of and with '.

answered Sep 10, 2019 at 20:21
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.