"语法错误:关键字ARG&QUOT后非关键字ARG;错误使用Python中requests.post时() [英] "SyntaxError: non-keyword arg after keyword arg" Error in Python when using requests.post()
问题描述
response = requests.post("http://api.bf3stats.com/pc/player/", data = player, opt)
在Python空转此行测试的东西我遇到语法错误后:关键字ARG后非关键字ARG
After running this line in the python IDLE to test things i encounter the syntax error: non-keyword arg after keyword arg.
不知道怎么回事这里。
播放
和选择
是包含一个词字符串变量。
player
and opt
are variables that contain a one word string.
推荐答案
尝试:
=响应requests.post(http://api.bf3stats.com/pc/player/,选择,数据=播放器)
您不能把一个非关键字参数关键字参数之后。
You cannot put a non-keyword argument after a keyword argument.
看一看的文档在<一个href=\"http://docs.python.org/2.7/tutorial/controlflow.html?highlight=keyword%20args#keyword-arguments\">http://docs.python.org/2.7/tutorial/controlflow.html?highlight=keyword%20args#keyword-arguments获取更多信息。
Take a look at the docs at http://docs.python.org/2.7/tutorial/controlflow.html?highlight=keyword%20args#keyword-arguments for more info.
这篇关于&QUOT;语法错误:关键字ARG&QUOT后非关键字ARG;错误使用Python中requests.post时()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!