import requests
import time
############ 向 importer 发送图片 url ###############
###### 所有 url 保存在 url 文件中 ###############
# 起始号码
urlFile = 'D:\\PythonProject1\\daxing_allpic_new.txt'
outputFile = 'D:\\PythonProject1\\daxing_allpic_newoutput.txt'
num = 0
importerToBeSent = "http://192.168.2.22:31080/general?img="
deviceId = "9999"
sleepTime = 1
outFile = open(outputFile, 'a')
with open(urlFile) as url_object:
for url in url_object:
url = url.rstrip("\n")
num = num + 1
Str = importerToBeSent + url + "&sensor=" + deviceId + "&width=250&height=250&ts=1542888600000"
response = requests.get(Str)
time.sleep(sleepTime)
if response.status_code == 200:
print(num)
print("==200=" + Str)
else:
print("Wrong!!" + Str)
#根据之前的计算,在笔记本上运行,大约可以达到 100 QPS 的速度