【发布时间】:2023-03-12 07:59:01
【问题描述】:
我正在从这个 codelab 在 Google Colaboratory 中尝试 tensorflow, 我需要下载“http://download.tensorflow.org/example_images/flower_photos.tgz”这个文件来完成实验。
如何下载文件。无论如何上传tar文件而不在我的机器上下载它。
我试过这个方法
import urllib
testfile = urllib.URLopener()
testfile.retrieve("http://randomsite.com/file.gz", "file.gz")
这不起作用,wget 也找不到。任何人都请告诉我如何做到这一点。
【问题讨论】:
-
试试
import urllib.request和urllib.request.urlretrieve()
标签: python python-3.x jupyter-notebook google-colaboratory