使用gedit打开downloadPath的文本文件时出现问题

时间:2020-10-21 09:22:01

标签: python nexus

从nexus下载依赖项后,我有一个下载路径供数据使用,但是我无法打开没有响应的纺织品,为什么会这样?

  for item in data["items"]:
     for asset in item["assets"]:
             fileurl = asset["downloadUrl"]
             print(fileurl)
             downloadPath = '/home/centos/'
             filename = downloadPath + fileurl.split('/')[-1]# '\' for Windows
             outfile = open(filename, "w")
             outfile.write(str(urllib.request.urlopen(fileurl).read()))
             outfile.close()
             if data["continuationToken"] is None:
                sys.exit()
             else:
             #construct pagination url and loop
                url = baseurl + 'components?continuationToken=' + data["continuationToken"] + '&repository=' + downloadRepository
             return

0 个答案:

没有答案