What should I do if I delete it by mistake using Jupyter Notebook?

When we are using Jupyter Notebook , we will find it is very easy to use, but it is inevitable that sometimes the hand is disabled and the code or files will be deleted accidentally, and the hard work will be in vain . How to solve it?
The following is divided into two situations:

A , I am writing code, which only a small file content deleted by mistake :
this time must not pass, do not pass, do not turn off jupyter notebook, do not leave, continues to recover following code:

for line in locals()['In']:
    print(line)
#或者, 直接的
history

It can be restored after one execution , which is very easy.

Second, delete multiple files directly on the jupyter notebook webpage.
Insert picture description here
At this point, the author went to inquire about the solution, and received the answer : "Don't think about how to restore it? Run away!" I knew it, it's over .
Just when I was desperate, I took a look at the computer recycle bin with uncertainty, wow wow wow! ! ! ! Excited Deleted files are inside, you can direct recovery! !
Insert picture description here
After the file is restored, you can also directly drag the file into the path saved by jupyter .
Then refresh the jupyter book page again, it will reappear.
It is recommended to change the saved path. In addition, sometimes when we need to modify or delete a certain file, we cannot delete or modify the name . Why?
Although the file below empty, but can not operate the following reasons:
Insert picture description here
We delete it , can not be deleted, then need to enter, Running run the following delete, and then delete it
Insert picture description here
** Finally, ** you can delete the file Or rename the operation.

                                                                                *欢迎交流和讨论,转载需要注明来源奥。谢谢。*

Guess you like

Origin blog.csdn.net/Louisliushahe/article/details/109675574