【发布时间】:2021-08-17 04:00:07
【问题描述】:
我正在使用 google colaboratory,它给了我错误消息
File "<ipython-input-1-41d5736708c2>", line 14 wget --no-check-certificate foo -O bar ^ SyntaxError: invalid syntax
这是我的代码
foo = 'https://example.com'
bar = '/tmp/' + foo.rsplit('/')[-1]
wget --no-check-certificate foo -O bar
我阅读了整个教程视频,但每个人都使用 wget https://example.com 而不是 wget (variable)
是否可以将 wget 与定义的变量一起使用?
【问题讨论】:
-
Format your error messages with `message` so it can preserve line breaks. -
嗨,谢谢您的建议
-
When accessing variables in Bash, add dollar signs before their names. wget --no-check-certificate foo -O bar becomes wget --no-check-certificate $foo -O $bar
标签: python tensorflow google-colaboratory wget