Python常见错误处理

1.TypeError: __init__() takes 1 positional argument but 5 were given

     使用 ps.connect("localhost", "root", "root123", "python") 连接mysql数据库报出如下错误:

               db = ps.connect("localhost", "root", "root123", "python")

              TypeError: __init__() takes 1 positional argument but 5 were given

     连接参数指定即可,修改为下面:

     ps.connect(host="localhost",user="root",password="root123",database="python")

原文地址:https://www.cnblogs.com/liyunzhouts/p/14593376.html