User avatar
Protheuz
Posts: 80
Joined: Sat May 11, 2013 5:24 pm
Location: In my chair, bed or sofa.

Python Questions - py2exe?

Tue Dec 31, 2013 10:45 pm

Hellolo!

I'm going to try to make a game, and I got some questions about that.
* py2exe question, is the ''downloader'' forced to download python or the modules that I'm gonna use? (I think PyGame)
* py2exe question, will the .exe work on the RPi? Or is there another similar that will make an ''executable''?(I need py2exe for windows)
* Is there any information that I really should know?

Thanks in advance!
Wiizard/Protheuz, just call me Kev.

rickseiden
Posts: 411
Joined: Thu Aug 02, 2012 12:21 pm
Location: Buffalo, NY, USA

Re: Python Questions - py2exe?

Wed Jan 01, 2014 9:43 pm

Without doubt, py2exe will not work for the Raspberry Pi. According to their own website:
py2exe is a Python Distutils extension which converts Python scripts into executable Windows programs.
The Raspberry Pi is not a Windows machine, so it can't run Windows executable.

This post on stackoverflow answers the question of how to make python scripts executable in Linux (which is what Raspberry Pi is running).
There are 10 types of people in this world. Those that understand binary, and those that don't.

treii28
Posts: 92
Joined: Fri May 10, 2013 4:52 pm

Re: Python Questions - py2exe?

Sun Dec 30, 2018 3:28 am

OK, py2exe may not be able to create programs that will run on raspberry pi, but there's no reason it couldn't create exe files that would run on a windows machine. It just needs to cross compile to suit the target platform. Now that doesn't mean anyone has ported the code over, but creating an exe and running an exe are two different things.

gkreidl
Posts: 6090
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Python Questions - py2exe?

Sun Dec 30, 2018 9:56 am

You could use nuitka which offers a standalone option (nuitka.net)
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

User avatar
MrYsLab
Posts: 372
Joined: Mon Dec 15, 2014 7:14 pm
Location: Noo Joysey, USA

Re: Python Questions - py2exe?

Sun Dec 30, 2018 2:12 pm

If having your users install your program using Python setup tools or pip is acceptable to you, you can configure setup.py specifying "Entry Points".
This will install the program as a native (Windows, macOS, Linux) executable that will be available on the command line for the user.
Here is a link that helps explain this:
https://chriswarrick.com/blog/2014/09/1 ... d-scripts/

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: Python Questions - py2exe?

Sun Dec 30, 2018 2:17 pm

MrYsLab wrote:
Sun Dec 30, 2018 2:12 pm
If having your users install your program using Python setup tools or pip is acceptable to you, you can configure setup.py specifying "Entry Points".
This will install the program as a native (Windows, macOS, Linux) executable that will be available on the command line for the user.
Here is a link that helps explain this:
https://chriswarrick.com/blog/2014/09/1 ... d-scripts/
The usual reasons for wanting to "compile" scripts are either:

1) Greater efficiency (i.e., a true "compile" should get you execution speeds on par with the equivalent program written in either C or assembler)

2) Encryption - i.e., don't want users to be able to see the source code.

Nowadays, it is almost always the later.

Now, I may be wrong (as I often am about things Python), but I don't think the "Entry Points" method (I read the URL briefly) speaks to either of these points. Am I wrong about that?
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

User avatar
MrYsLab
Posts: 372
Joined: Mon Dec 15, 2014 7:14 pm
Location: Noo Joysey, USA

Re: Python Questions - py2exe?

Sun Dec 30, 2018 2:42 pm

You are correct. Since the op does not provide a rationale for wanting the .exe, I offer this as a possible solution.
It all depends upon the project's requirements.

Return to “Python”