2

I am new to Python. Please excuse me if my question seems stupid. I have spent a lot of time before posting this.

When I searched for shipping python interpreter with the applications, I found solutions including installing separate applications, using third party modules, etc...

I was thinking of more direct approach: I first install python interpreter on my machine (windows). Then I ship the installed python interpreter (copy and paste the folder) with the pyc file of my application. And finally I create a simple batch program that executes the interpreter and running the pyc file. In this case, the user can simply run the application by simply running the batch program. I have tried it and it worked.

Although this solution seems the most obvious and the easiest one, I am in a doubt about it because I cannot find any one mentioning it. Is there anything wrong with my solution? I usually create desktop applications for windows.

Thanks in advance.

4
  • Freezing tools -- “Freezing” your code is creating a single-file executable file to distribute to end-users, that contains all of your application code as well as the Python interpreter. Commented Jul 6, 2020 at 8:48
  • DarrylG I tried pyInstaller for a simple testing file which calls another simple file. The produced executable was accompanied with 53 files! I guess most of them are python modules and Visual C++ redistributables. Commented Jul 7, 2020 at 8:33
  • 1
    @VinoRue--the result can be a simple file or everything can be in one file What PyInstaller Does and How It Does It. For single file: pyinstaller --onefile --windowed myscript.py Commented Jul 7, 2020 at 9:21
  • @DarrylG--OK. Thank you. Commented Jul 7, 2020 at 16:18

1 Answer 1

0

Make a virtual environment for you application and then run run the command python filename.py --onefile --windowed while still being in the virtual env. activated,

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.