def DownHTTP(url,fileName):
fileHTTP = urllib.URLopener()
if fileName == "":
if os.path.isfile(url.split("/")[len(url.split("/"))-1]) == 1:
newName = url.split("/")[len(url.split("/"))-1].split(".")[0]+"_."+url.split("/")[len(url.split("/"))-1].split(".")[1]
fileHTTP.retrieve(url,newName)
return " saved the file with the original name + \"_\""
else:
fileHTTP.retrieve(url,url.split("/")[len(url.split("/"))-1])
return " saved the file with the original name"
else:
fileHTTP.retrieve(url,fileName)
return " saved the file with the given name"
评论列表
文章目录