Python Forum
Recover currently running script?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Recover currently running script?
#1
I have a program that I used Notebook++ to write, and I did not back it up for the past two weeks even though I put a ton of work into it.  I ran the script using iPython in Powershell and then Notebook crashed and completely wiped out the original code.  The file name is saved with no lines of code in it.  I am a relatively new programmer who learned the hard way why backing up and GitHub are so important, but does anyone have any idea of a way that I can recover the code, especially since it is still running in iPython?   There must be a cache of it somewhere or a magic function that will show the code that is in memory?  Any help would be incredibly appreciated!
Reply
#2
you mean notepad++ right?

hopefully you've learned a valuable lesson. i think you'd have better luck reaching out on an iPython forum, maybe a copy of it is made somewhere along the line. Maybe notepad++ has it cached somewhere but i would have no clue, better to ask on a notepad++ forum heh. good luck!
Reply
#3
what happens if you type object_name?
(include the ?)

I would take a look at what's available in inspect (needs to be imported) in addition, ipython has some builtin commands that may be of help.
Sorry that I don't have specifics, but it's something. It seems that you might find some way to inspect your namespace.
Reply
#4
Not sure which version of Windows you're using, but in Windows 10, Notepad++ will keep a backup file that it is working on in the C:\Users\user_name \AppData\Roaming\Notepadd++\backup. It might have a name like:
file_name.py@2016-12-07_084239. If your lucky, it might still be there.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  No Internet connection when running a Python script basil_555 8 443 Mar-11-2024, 11:02 AM
Last Post: snippsat
Question Running Python script through Task Scheduler? Winfried 8 340 Mar-10-2024, 07:24 PM
Last Post: Winfried
  Help Running Python Script in Mac OS emojistickers 0 306 Nov-20-2023, 01:58 PM
Last Post: emojistickers
  Trying to make a board with turtle, nothing happens when running script Quascia 3 608 Nov-01-2023, 03:11 PM
Last Post: deanhystad
  Python script running under windows over nssm.exe JaroslavZ 0 675 May-12-2023, 09:22 AM
Last Post: JaroslavZ
  Running script with subprocess in another directory paul18fr 1 3,483 Jan-20-2023, 02:33 PM
Last Post: paul18fr
  Running script on multiple files Afrodizzyjack 1 2,469 May-14-2021, 10:49 PM
Last Post: Yoriz
  Error when running script on startup in Linux NoahTheNerd 0 1,927 Mar-07-2021, 04:54 PM
Last Post: NoahTheNerd
  Refresh data in python script while running in Terminal frankenchrist 4 7,109 Feb-03-2021, 09:54 AM
Last Post: Larz60+
  [SOLVED] Requiring help running an old Python script (non Python savvy user) Miletkir 13 5,309 Jan-16-2021, 10:20 PM
Last Post: Miletkir

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020