Making exe files with Python 3 in Linux?
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 30 days after creation.
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 30 days after creation.
Making exe files with Python 3 in Linux?
As you may already know - in my free time I use Python to lose this time.
I'm creating small text based games using the same "snake" language and in Windows it was rather easy to make exe files thanks to cx_Freeze. For some strange reason or lazyness I wasn't able to do the same task in Mint. For the moment I'm away from my Linux PC and I can't say what exactly goes wrong (maybe I wasn't able to install cx_Freeze on Mint) but the truth is that I never succeeded.
Any suggestions what can cause this problem?
Thanks in advance.
I'm creating small text based games using the same "snake" language and in Windows it was rather easy to make exe files thanks to cx_Freeze. For some strange reason or lazyness I wasn't able to do the same task in Mint. For the moment I'm away from my Linux PC and I can't say what exactly goes wrong (maybe I wasn't able to install cx_Freeze on Mint) but the truth is that I never succeeded.
Any suggestions what can cause this problem?
Thanks in advance.
Last edited by LockBot on Wed Dec 07, 2022 4:01 am, edited 1 time in total.
Reason: Topic automatically closed 30 days after creation. New replies are no longer allowed.
Reason: Topic automatically closed 30 days after creation. New replies are no longer allowed.
Re: Making exe files with Python in Linux?
For Linux and Windows I use PyInstaller. A much better program and it can compile everything into a single executable, I highly recommend it.
http://www.pyinstaller.org
http://www.pyinstaller.org
Re: Making exe files with Python in Linux?
Looks nice but the latest supported version of Python is 2.7. I'm working with 3.4.1. Have you tested it under Python versions 3.x?var wrote:For Linux and Windows I use PyInstaller. A much better program and it can compile everything into a single executable, I highly recommend it.
http://www.pyinstaller.org
Re: Making exe files with Python in Linux?
I only use Python 2.7 (I dislike version 3) so I have not tested it with any other version.
Re: Making exe files with Python in Linux?
Anyway your idea is very good and I like it but soon or later Python 2.7.x will reach it's end of life. That's why I prefer 3.x.var wrote:I only use Python 2.7 (I dislike version 3) so I have not tested it with any other version.
Re: Making exe files with Python in Linux?
change the extension to .exe
BOOM DONE!
There is no such thing in linux. Executable files are set by an executable bit in their permissions, not by the file extension as file extensions really are just a few letters at the end of the name.
You can chmod +x or right click the file and chose to make it an executable, and then at the top of the text of the file add #!/usr/bin/python to tell bash to run the file with python.
BOOM DONE!
There is no such thing in linux. Executable files are set by an executable bit in their permissions, not by the file extension as file extensions really are just a few letters at the end of the name.
You can chmod +x or right click the file and chose to make it an executable, and then at the top of the text of the file add #!/usr/bin/python to tell bash to run the file with python.
Re: Making exe files with Python in Linux?
I think he means to make the python script a self-contained executable file. Not an executable python script.scryan wrote:change the extension to .exe
BOOM DONE!
There is no such thing in linux. Executable files are set by an executable bit in their permissions, not by the file extension as file extensions really are just a few letters at the end of the name.
You can chmod +x or right click the file and chose to make it an executable, and then at the top of the text of the file add #!/usr/bin/python to tell bash to run the file with python.
Big difference.
Re: Making exe files with Python in Linux?
Would this even be done in linux?var wrote:I think he means to make the python script a self-contained executable file. Not an executable python script.scryan wrote:change the extension to .exe
BOOM DONE!
There is no such thing in linux. Executable files are set by an executable bit in their permissions, not by the file extension as file extensions really are just a few letters at the end of the name.
You can chmod +x or right click the file and chose to make it an executable, and then at the top of the text of the file add #!/usr/bin/python to tell bash to run the file with python.
Big difference.
Would any stand alone require a way to interpret python as a dependency.... so basically the same as having python on your system...
Re: Making exe files with Python in Linux?
You might want to check out python eggs, they are sort of like .jar files for Java. I use setuptools for some of my python projects which allows you to declare stuff like dependencies, entry points for your program, and even to install your scripts.
Re: Making exe files with Python in Linux?
http://www.py2exe.org/
--circa 2008, probably works with your older Python version 2.7x
--circa 2008, probably works with your older Python version 2.7x
Re: Making exe files with Python in Linux?
He is looking for a linux solution for creating exe files...DrHu wrote:http://www.py2exe.org/
--circa 2008, probably works with your older Python version 2.7x
Though I am not sure if he want to make exe files for windows, since linux doesn't really have exe files, if he means he wants to create stand alone binary image of some kind, or if he just want to be able to click and run....
Re: Making exe files with Python in Linux?
Not sure if this is what you're looking for but, http://www.pyinstaller.org/
Re: Making exe files with Python in Linux?
Yes, a program like this BUT for Python 3.x. No success for now except with cx_Freeze which as I already mentioned is giving some strange problems.xenopeek wrote:Not sure if this is what you're looking for but, http://www.pyinstaller.org/