功能字典輸入我有看到一些這樣的代碼波紋管:的蟒蛇
params = {
'username': username,
'password': password,
'attended': attended,
'openid_identifier': openid_identifier,
'multistage': (stage and True) or None
}
ret = authmethod.login(request, userobj, **params)
登錄實現這樣
def login(self,request,user_obj,**kw):
username = kw.get('username')
password = kw.get('password')
,所以我們知道千瓦是一本字典,但我不知道**
的含義,是否像C語言中的指針一樣?是用來輸入字典作爲參考。
謝謝你,如果你能回答我。
只是一個提示:它更類似於C的``或'`爲Python的關鍵字參數... –
hvr
2011-02-14 07:50:20