Python Forum
Recovering lost source code when the code is running in memory
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Recovering lost source code when the code is running in memory
#1
I think that this question came up multiple times on previous incarnations of the forum, and when I saw the following I wanted to get it documented here for the next time - https://gist.github.com/simonw/8aa492e59...618f9e6b12
Reply
#2
is this better than making backups?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#3
Certainly not. It solves a different problem.
Reply
#4
(Mar-29-2017, 02:16 AM)micseydel Wrote: Certainly not. It solves a different problem.

it looked like the same problem to me:  user error with the rm or delete command.  need to restore the lost file.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#5
One solves the problem proactively. You must take prior action. It's more effective. It's great.

The other is an "oh shit, I didn't do anything to protect myself" kinda thing and is useful when accidents happen. I'm not going to lose committed code, but accidents do happen sometimes.
Reply
#6
my editor command (aliased as "e" ,,, how i use it). make a date-time stamped backup each time i edit the file.  i should mod it to make repo commits and make public.  i've been doing this for at least the past 15 years.  i rewrote it into python just last month Dance
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#7
May I ask why you are so compelled to rewrite something that's already written quite well in the first place?
Reply
#8
(Mar-30-2017, 02:03 AM)Larz60+ Wrote: May I ask why you are so compelled to rewrite something that's already written quite well in the first place?

python makes it easier to add features.

i started, tonight, working on a new feature to make the my e command and my keep command (part of a module now) have a configurable option to store the copies it makes in a specific directory.  it uses my pyconfig function to get the directory name from the config file.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#9
(Mar-30-2017, 02:03 AM)Larz60+ Wrote: May I ask why you are so compelled to rewrite something that's already written quite well in the first place?

That is always the point... If nononee ever rewrote something that is thought to be well written, we would all still be coding in Fortran or A(PL).
Reply
#10
Quote:That is always the point... If nononee ever rewrote something that is thought to be well written, we would all still be coding in Fortran or A(PL).

I would agree you, but only to an extent.
When I work on my car, I don't first try and re-invent the lift.

The lift has worked well for what is does for many years.
That's not to say that is shouldn't be improved.

After 50 years of professional programming, I must say that I have seen
a lot of wasted time spent on attempting to re-write applications that are already
extremely good, instead of placing the effort on those that really need to be re-written.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Convert Python code to MATLAB code bitoded 4 4,822 Dec-30-2022, 02:06 AM
Last Post: Larz60+
  looking for code that substitues parts of python code Skaperen 0 1,181 Jul-07-2022, 11:34 PM
Last Post: Skaperen
  compiling but not running source code Skaperen 1 1,292 Jun-05-2022, 10:47 PM
Last Post: Gribouillis
  running produced python code Skaperen 6 1,855 Dec-25-2021, 05:52 PM
Last Post: Skaperen
  code running after tracebacks Skaperen 0 1,237 Oct-03-2021, 12:09 AM
Last Post: Skaperen
  empty lines in source code Skaperen 6 2,939 Jun-02-2021, 07:11 PM
Last Post: Gribouillis
  Running three-year old python code ErnestTBass 4 2,470 Jun-19-2020, 02:46 PM
Last Post: snippsat
  visual studio code python how to get source code of import module definitian umen 2 3,865 Jun-13-2020, 06:20 PM
Last Post: umen
  Code Runner In VS-Code - Problem With User Input adt 5 9,609 Sep-10-2019, 04:59 PM
Last Post: adt
  Where can I get information about internal logic of source code Python? AlekseyPython 1 2,488 Dec-17-2018, 05:27 AM
Last Post: siripriya

Forum Jump:

User Panel Messages

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