在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/Python/ python 函數(shù)參數(shù)無故報(bào)錯

python 函數(shù)參數(shù)無故報(bào)錯

 self.proxyauth_plugin_path = self.create_proxyauth_extension(proxy_host="117.41.186.194",proxy_port="888",proxy_username="we41a",proxy_password="we41a",scheme="https",plugin_path=None)

         self.driver.add_extension(self.proxyauth_plugin_path)


         self.driver = webdriver.Chrome(options=options)

     def create_proxyauth_extension(proxy_host, proxy_port,
                                    proxy_username, proxy_password,
                                    scheme, plugin_path):
                                    
                                    
                      
                      
         

clipboard.png

我明明6個參數(shù)為啥說我7個參數(shù),求解,謝謝!
回答
編輯回答
你好胸

會不會是少了self參數(shù)?

2018年4月8日 13:11
編輯回答
薔薇花

類內(nèi)部的方法如果不聲明成類方法(@classmethod),那么它的第一個參數(shù)默認(rèn)指向類的實(shí)例,相當(dāng)于平常用的self。第一個參數(shù)起什么名都無所謂的,python解釋器會自動將第一個參數(shù)設(shè)定為實(shí)例自身,并不是你不寫self,python就不傳入類的實(shí)例,所以,在調(diào)用時,加上你給的6個,python解釋器一共傳了7個

2017年1月16日 07:54
編輯回答
臭榴蓮
def create_proxyauth_extension(self, 
                            proxy_host, proxy_port,
                            proxy_username, proxy_password,
                            scheme, plugin_path):
2017年7月8日 09:23