调用@YFSafe 的API报错
[Python] 纯文本查看 复制代码 #api.py
# 导入requests模块,并且简写为re
import requests as re
# 确定网址
def getVir(md5):
url = 'http://yfchat.xyz/api.php?md5=' + md5
res = re.get(url).text
return res
[Python] 纯文本查看 复制代码 #api-test.py
import api
print(api.getVir(1f0d5e334a))
报错信息:
Traceback (most recent call last):
File "F:\Python Project\get-virus-api\api-test.py", line 8, in <module>
print(getApiRes())
File "F:\Python Project\get-virus-api\api-test.py", line 4, in getApiRes
isVir = api.getVir(1)
File "F:\Python Project\get-virus-api\api.py", line 8, in getVir
url = 'http://yfchat.xyz/api.php?md5=' + md5
TypeError: can only concatenate str (not "int") to str
@xiaomeng242
|