python开发报错总结

1

pymysql.err.ProgrammingError: (1064, "You have an error 
in your SQL syntax; check the manual that corresponds 
to your MySQL server version for the right syntax 
to use near '),('150100',),'30000以上','牵引车')' at line 1")

仔细看报错信息 (‘150100’,) 这是元组,不能直接插入书库,用角标即可
例如元组result 改成result[0]即可

2

pymysql.err.InterfaceError: (0, '')

我的错误是提前关闭了数据库链接,从而导致报错,这种错误就从数据库链接的角度去看就可以了

3

unexpected indent

这是缩进的问题,把代码粘贴到pycharm中即可

猜你喜欢

转载自blog.csdn.net/qq_38220334/article/details/106528601