【已解决】TypeError: bind() takes exactly one argument (2 given)
生活随笔
收集整理的這篇文章主要介紹了
【已解决】TypeError: bind() takes exactly one argument (2 given)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
錯誤代碼:
server.bind('0.0.0.0', 8000)正確代碼:
server.bind( ('0.0.0.0', 8000) )兩層括號
原因:bind函數內應傳入元組。 外層括號是函數的括號;內層括號是元組的括號
總結
以上是生活随笔為你收集整理的【已解决】TypeError: bind() takes exactly one argument (2 given)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【可运行,刘汝佳代码】Trees on
- 下一篇: ConnectionRefusedErr