1. Using the Pymysql link database times error
Error code:
SyntaxError: unexpected EOF while parsingProcess finished with exit code 1
2. Here's My Code
import pymysql## 链接数据库connection = pymysql.connect(host = 'localhost',user = 'root',passwd = 'gangan',db = 'qiandao')try: cur = connection.cursor() cur.execute("SELECT fk_si_user,si_trueName from fbl_stuinfo where si_trueName like '甘%'") data = cur.fetchall() for row in data: print('%s\n%s'%row) cur.close() connection.commit()
What does 3.EOF error mean, and what is the general solution? Python 3.5 Newcomers
Reply content:
1. Using the Pymysql link database times error
Error code:
SyntaxError: unexpected EOF while parsingProcess finished with exit code 1
2. Here's My Code
import pymysql## 链接数据库connection = pymysql.connect(host = 'localhost',user = 'root',passwd = 'gangan',db = 'qiandao')try: cur = connection.cursor() cur.execute("SELECT fk_si_user,si_trueName from fbl_stuinfo where si_trueName like '甘%'") data = cur.fetchall() for row in data: print('%s\n%s'%row) cur.close() connection.commit()
What does 3.EOF error mean, and what is the general solution? Python 3.5 Newcomers
You should put all the errors on the report, it is not necessarily because even MySQL, the most likely is your print problem
Print (r'%sn%s '%row) put a r in front of the test