Thanks to @tomkirn for providing the solution at this earlier question: https://forum.omz-software.com/topic/5835/crash-on-open
If you wanna access the file contents again, in the same directory do:
with open("{filename}.py","r") as r: oldcontent = r.readlines() with open("{otherfilename}.txt","w+") as f: f.writelines(oldcontent)To Ensure your editor doesn’t load it as a py file and crash, and also so that you may pick out the part of the file you believe is causing the crash to occur!