标签:sts daemon end time utf-8 __name__ min username pre
一、同一用户并发上传不同文件内容
#coding=utf-8
import requests
import threading
from time import ctime,time
# D:\\code\\budget_test\\api\\1.xlsx‘
filelist=[‘C:\\Users\\53843\\Desktop\\1.xlsx‘,
‘C:\\Users\\53843\\Desktop\\2.xlsx‘
]
def t1(filedir):
data1 = {
‘username‘:"admin",
‘password‘:"111",
‘loginbutton‘:"登 录"
}
s = requests.session()
s.post(url=‘http://172.16.1.64:8080/business-analysis-1.0/a/login‘,data=data1)
print ("I was at the %s " %ctime())
files={‘file‘: open(filedir, ‘rb‘)}
print ("I was at the %s start!" %ctime())
r=s.post(url=‘http://172.16.1.64:8080/business-analysis-1.0/a/budget/budgetHead/excelTodata‘,files=files)
print(r.text)
threads=[]
nub=2
for i in range(2):
threads.append(threading.Thread(target = t1(filelist[i])))
if __name__==‘__main__‘:
for t in threads:
t.setDaemon(True)
t.start()
t.join()
print("all over %s"%ctime())
标签:sts daemon end time utf-8 __name__ min username pre
原文地址:https://www.cnblogs.com/szmcn/p/9334864.html