简体   繁体   中英

How can I use jupyter to edit a file on jupyter server, such as "~/.bashrc”

I want to edit a file on Jupyter server, add "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/slim/python/slim" to "/.bashrc". but I can't switch to bash terminal window. If can I edit "/.bashrc" directly using Jupyter? Thanks!

You can use %%writefile myfile to to save the content of the current cell into a file. Use %less myfile to show the file content:

In [1]: %%writefile myfile
        My file content

In [2]: %less myfile

You can load the file content with %load myfile into a cell first.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM