OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to pack a python to exe while keeping .py source code editable?

  • Thread starter Thread starter Wyatt Gillette
  • Start date Start date
W

Wyatt Gillette

Guest
I am creating a python script that should modify itself and be portable.

I can achieve each one of those goals separately, but not together.

I use cx_freeze or pyinstaller to pack my .py to exe, so it's portable; but then I have a lot of .pyc compiled files and I can't edit my .py file from the software itself.

Is there a way to keep a script portable and lightweight (so a 70mb portable python environment is not an option) but still editable?

The idea is to have a sort of exe "interpreter" like python.exe but with all the libraries linked, as pyinstaller allows, that runs the .py file, so the .py script can edit itself or be edited by other scripts and still be executed with the interpreter.
<p>I am creating a python script that should modify itself and be portable.</p>
<p>I can achieve each one of those goals separately, but not together.</p>
<p>I use cx_freeze or pyinstaller to pack my .py to exe, so it's portable; but then I have a lot of .pyc compiled files and I can't edit my .py file from the software itself.</p>
<p>Is there a way to keep a script portable and lightweight (so a 70mb portable python environment is not an option) but still editable?</p>
<p>The idea is to have a sort of exe "interpreter" like python.exe but with all the libraries linked, as pyinstaller allows, that runs the .py file, so the .py script can edit itself or be edited by other scripts and still be executed with the interpreter.</p>
 

Latest posts

Top