ProgrammingError: (1064, "You have an error in your SQL syntax

1. Use version 1.2.5 of the mysqldb library. An error was reported when inserting the database in the pipeline file of scrapy.
clipboard.png

2.

clipboard.png

pipeline
import MySQLdb
import os.path

class ProjectPipeline(object):



clipboard.png

3.scrapy

import MySQLdb
import os.path

class WeatherPipeline(object):


clipboard.png

clipboard.png

clipboard.png

clipboard.png

4. So here"s the problem! Why did I check it many times and didn"t find any difference between the two, which led to the syntax error of my first file! I am a novice, doing graduation project, sincerely beg God not to dislike, give me some advice! Thank you!

Mar.13,2021

. After such a long time, let's look at this problem again! I get it!
what python calls a format string!
a = 'ztm'
print' ab%scd'%a
then abztmcd
a = 'ztm'
b = 123
print' ab%scd%de'% (a br >)

is output abztmcd123de

Menu