由于colab上没有直接转换成html文档的选,所以需要自己设置转换的要求。
下面是转换的步骤
from google.colab import files
uploaded = files.upload()
for filename in uploaded.keys():
print('Your notebook file "{name}" has been uploaded to the colab machine instance'.format(name=filename))
output:
5245_HW4_jf3283.ipynb(n/a) - 104620 bytes, last modified: 11/23/2020 - 100% done
Saving 5245_HW4_jf3283.ipynb to 5245_HW4_jf3283.ipynb
Your notebook file “5245_HW4_jf3283.ipynb” has been uploaded to the colab machine instance
运行上面的code将会 从本地电脑选择文件,然后上传到colab
直接运行这行代码
!jupyter nbconvert --to html *.ipynb
[NbConvertApp] Converting notebook 5245_HW4_jf3283.ipynb to html
[NbConvertApp] Writing 399771 bytes to 5245_HW4_jf3283.html
files.download(filename[:-5]+'html')
结束