I am cleaning up my code and have a number of sqlite3 execute statements that extend far past 80 characters.

From my reading implicit line joining with (), [] or {} seems to be the preferred method, but

cur.execute('SELECT Account FROM pwds WHERE Category=? ORDER BY Account
        COLLATE NOCASE', cat)

gives this error:

jfb@jims1204:~/MyProgs/passwords$ python passwords.py
  File "passwords.py", line 50
    cur.execute('SELECT Account FROM pwds WHERE Category=? ORDER BY Account
                                                                          ^
SyntaxError: EOL while scanning string literal

Using a \ seems to be out of favor but it works in this case.

cur.execute('SELECT Account FROM pwds WHERE Category=? ORDER BY Account\
        COLLATE NOCASE', cat)
# no error.

What am I not understanding about implicit line joining?

Thanks,  Jim

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to