Python AttributeError: 'str' object has no attribute 'cursor'
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Today is my 3rd day learning Python and despite numerous web searches I can't seem to get past this issue. The code takes in input on the command line and passes it to the connection script fine and it connects. The problem comes when I try to connect the cursor to the connection object on the line that reads: cor = con.cursor() . I get the error message: AttributeError: 'str' object has no attribute 'cursor' . Basically all I'm trying to do is take in parameters for my connection string to connect to the database and then be able to run my