Retrieving files from remote IPython notebook serv

2019-03-11 04:55发布

问题:

If I don't want to give out SSH access to users of my remote IPython notebook server. Is there a way to let users browse non .ipynb files and download them?

回答1:

You can use FileLink and FileLinks that are built-in:

from IPython.display import FileLink, FileLinks
FileLinks('.') #lists all downloadable files on server

The code above generates:

./
some_python_file.py
some_xml_file.xml
some_ipynb_file.ipynb

The three items above are links that you can click to download.

Click here for an example from ipython.org