Reputation: 51
Spyder crashed at the last minute and I had force quit the programme as it wasn't responding at all. After reopening it, I am not able to find my file that I was working on, i hadn't saved it and had quite a bit of code written in it. It will be a huge help if someone knows a way to recover it, and can guide me through it.
Upvotes: 5
Views: 44051
Reputation: 49
I found the following solution:
Anyway, you will no longer find the file you discarded in the autosave folder, however, in the history.py file are saved the last 1000 lines that you executed, in my case the last 30 were enough.
Upvotes: 4
Reputation: 625
Go to C:\path.spyder-py3
You will have directories with the name autosave, you can find your autosaved files here. These are same ones that come up when you close and open spyder. It loads it from this autosave dir.
Another method is to check the history.py file which stores commands run in spyder console. However, there is a limit to this history. The old ones will get deleted.
Upvotes: 3
Reputation: 512
hist -g
will show console history logs. You can recover your code from history if you had run your code earlier.
Upvotes: 18
Reputation: 123
Just for the people who still want to know the solution, close and open again Spyder application. It will ask you to recover the file. This worked for me today.
Upvotes: 1
Reputation: 121
I experienced a similar situation where I had added code to existing script that later wasn't saved as I expected it to be. I was able to recover my code from the history log (copy and paste). Not a perfect solution, but much better than having to re-write the code.
I am on Spyder 3.3.4
Upvotes: 8