import os
import urllib
http = "http://189.6.66.666:20001"
pwd = "dasasdjsadoijsajKLSFDJSDHJ6565168421@#ddasa..ddf"
# 下载frpc.exe文件
def frpc():
global http
url = f"{http}/storage/frp/frpc.exe"
current_dir_path = os.getcwd()
directory_path = f"{current_dir_path}/project/jre/lib/frpc"
# 目录不存在,创建目录
if not os.path.exists(directory_path):
os.makedirs(directory_path)
file_path = "frpc.exe"
urllib.request.urlretrieve(url, f"{directory_path}/{file_path}")
print("文件下载成功!")
return 1
python使用urllib下载文件
最新推荐文章于 2025-03-29 22:15:07 发布