'r' open for reading (default)
'w' open for writing, truncating the file first
'x' create a new file and open it for writing
'a' open for writing, appending to the end of the file if it exists
'b' binary mode
't' text mode (default)
'+' open a disk file for updating (reading and writing)
'U' universal newline mode (deprecated)
使用request库下载,调用接口
import os
# import os
# os.system('wget http://10.12.135.244:8989/download/windows_x64/PecStarV4.0_4.5.2.1.1.exe')
import requests
url = 'http://10.12.135.244:8989/download/windows_x64/PecStarV4.0_4.5.2.1.1.exe'
response = requests.get(url)
# os.mkdir("download")
with open('./download/PecStarV4.0_4.5.2.1.1.exe', 'wb') as f:
f.write(response.content)