"语法错误:关键字ARG&QUOT后非关键字ARG;错误使用Python中requests.post时() [英] "SyntaxError: non-keyword arg after keyword arg" Error in Python when using requests.post()

查看:162
本文介绍了"语法错误:关键字ARG&QUOT后非关键字ARG;错误使用Python中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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆