【发布时间】:2020-02-28 05:38:16
【问题描述】:
我在打印行收到语法错误 EOL。我尝试添加更多逗号,但它不起作用。
def getAuthorized(url, username, password):
r = requests.get(url, auth=(username, password))
if str(r.status_code) != '401':
print "\n[!] Username: " + username + " Password: " + password + "
Code: " + str(r.status_code) + "\n"
提前谢谢你!!
【问题讨论】:
-
您不能在(单引号)字符串文字的中间换行。在
+之后换行或根本不换行。 -
@RithinChalumuri 注意
print声明;这是 Python 2。
标签: python python-2.7 printing beautifulsoup pip