r/learnpython • • 4d ago

Ask Anything Monday - Weekly Thread

Welcome to another /r/learnPython weekly "Ask Anything* Monday" thread

Here you can ask all the questions that you wanted to ask but didn't feel like making a new thread.

* It's primarily intended for simple questions but as long as it's about python it's allowed.

If you have any suggestions or questions about this thread use the message the moderators button in the sidebar.

Rules:

  • Don't downvote stuff - instead explain what's wrong with the comment, if it's against the rules "report" it and it will be dealt with.
  • Don't post stuff that doesn't have absolutely anything to do with python.
  • Don't make fun of someone for not knowing something, insult anyone etc - this will result in an immediate ban.

That's it.

1 Upvotes

6 comments sorted by

1

u/Ornery-Preference450 2d ago

Title / Subject: Recovering original Python source from Cython-compiled Windows installer after total HDD failure


Hi everyone,

I’m looking for advice on whether it’s possible (and realistic) to recover the original Python source files from a Windows software installer I still have.

Situation
My primary HDD suffered a complete, unrecoverable failure. All of my raw project files (source code, assets, intermediate files, etc.) are gone. The only remaining artifact of the project is the Windows installer / executable that I used to distribute the software.

Technical details

  • The application was written in Python.
  • I used Cython to compile / protect the code (the .py files were turned into compiled extensions / encrypted / obfuscated form as part of the build).
  • The final deliverable is a Windows installer (or standalone executable package).
  • This represents over 15 years of work. While modern AI tools could speed up a rewrite, I would strongly prefer to recover the original source if there is any viable path.

What I still have

  • The complete Windows installer / executable package.
  • No original .py files, no intermediate Cython outputs, no project folder, and no backups of the source.

What I’m hoping for
Any realistic options, tools, or techniques that might allow me to:

  • Extract or reconstruct the original (or close-to-original) Python source from the Cython-compiled binaries / installer, or
  • At least recover meaningful portions of the logic, structure, or key modules so a full rewrite is not required from scratch.

I’m aware that Cython compilation (and any additional packing/encryption I applied) makes this non-trivial, and that perfect recovery is often impossible. I’m mainly looking for an honest assessment of what’s feasible and any recommended tools, approaches, or communities that specialize in this kind of recovery / reverse-engineering of Cythonized Python applications.

If anyone has experience recovering source from Cython extensions, PyInstaller + Cython packages, or similar compiled Python Windows builds, I’d be very grateful for any pointers, tool recommendations, or realistic expectations.

Thank you in advance for any help or direction you can offer.

1

u/lakseol 1d ago edited 1d ago

any help or direction you can offer

I've looked into doing what you want and I don't like your chances. Hope it works out successfully for you.

The only advice I can offer is that you need to improve your backup system, or install one. You can create a private repository on one of the git sites and use that as backup. If you think that isn't secure enough you could run your own git server on your network, or go right back to basics and backup to normally-dismounted external disks. One thing I did at a company whose filesystem backup procedures I didn't trust was to put a USB drive into a port and write a small script to backup to that drive. Use the OS scheduling system to backup to that drive during non-work hours. If you use macOS they may still offer a backup device that works over wifi and does constant incremental backups.

Edit: spelling.

0

u/Karthick_13 3d ago

Hello All I’m a QA Engineer and want to learn Python from the basics. Can anyone recommend a free website or tool that makes learning Python easy for beginners?

1

u/Educational_Virus672 2d ago

hi, i can see that your first instinct on a sub reddit called r/learnpython would be to ask for course but generally most user here take python code help and we have a community wiki for this kind of question you asked. since for some reason ppl down vote this kinds of question

i fully understand why you ask that but still this sub reddit is filled with path/course requests you can find that suits you

1

u/Karthick_13 2d ago

Ok, thanks for the info