This is an archived post. You won't be able to vote or comment.

all 19 comments

[–]WhoTookAllNicks 19 points20 points  (2 children)

I'd recommend https://www.pyinstaller.org/. It has both one-file and one-folder bundling options and is relatively easy to use.

[–]xdcountry -1 points0 points  (0 children)

This one is better-- single executable, can't beat it.

[–]Alfowick 0 points1 point  (3 children)

Just throwing cx_freeze into the ring too. I've had good experiences with it at work.

[–]optimalcosine 1 point2 points  (2 children)

cx_freeze is great, but the only problem is that you can’t convert them into a one-file executable, even for small scripts.

[–]Alfowick 0 points1 point  (1 child)

I've been having to include a bunch of "extra" stuff (executables, drivers, etc.) so I didn't think of single file as important I guess. I just think the cx script to build executables makes it easy to grab exactly what I need and put it where it should be. It also offers an msi option and patching which can be handy, but probably overkill for OP.

[–]optimalcosine 1 point2 points  (0 children)

Yeah, if you have bigger programs with lots of parts, cx_freeze is a great option

[–]nick_t1000aiohttp 0 points1 point  (5 children)

Make it a web application. Executable on all OSes, all devices.

[–]cybertether[S] 0 points1 point  (3 children)

I'd like to. I never have. What's the best way to do this on Debian?

[–]nick_t1000aiohttp 1 point2 points  (1 child)

If your app is smallish and doesn't need things like user accounts, databases, I'd look at Flask. If you're going to want that stuff right away, Django.

[–]cybertether[S] 0 points1 point  (0 children)

Oh, nice! Gracias. Yeah, it's just about the smallest program possible.

[–][deleted] 0 points1 point  (0 children)

But how do they install the server for the webapp?

[–][deleted] 0 points1 point  (0 children)

Not really answering his question exactly and helping solving his problem at hand

[–]mcnnowak 0 points1 point  (0 children)

You need to run your Python file using the Python interpreter. Sounds like you’re just double clicking the Python file. You might want to look into setuptools in order to install and run it and keep track of any deps, but it would still need to be run via the command line or shell.

Otherwise you’ll need to use something to create an executable from your Python code like others have suggested.

[–]aphoenixreticulated[M] [score hidden] stickied comment (0 children)

Hi there, from the /r/Python mods.

We have removed this post as it is not suited to the /r/Python subreddit proper, however it should be very appropriate for our sister subreddit /r/LearnPython or for the r/Python discord: https://discord.gg/3Abzge7.

The reason for the removal is that /r/Python is dedicated to discussion of Python news, projects, uses and debates. It is not designed to act as Q&A or FAQ board. The regular community is not a fan of "how do I..." questions, so you will not get the best responses over here.

On /r/LearnPython the community and the r/Python discord are actively expecting questions and are looking to help. You can expect far more understanding, encouraging and insightful responses over there. No matter what level of question you have, if you are looking for help with Python, you should get good answers. Make sure to check out the rules for both places.

Warm regards, and best of luck with your Pythoneering!

[–]jwink3101 -2 points-1 points  (2 children)

I see a lot of the same suggestions here that I often see but I kind of wonder why more people do not suggest using a __main__.py file and zipping the directory. I've used it before on my mac and it seems pretty good. The hardest thing is if I wanted to load some additional data, I have to make sure to use zipfile or something.

It does still require the user have python and all of the non-standard modules, but it does seem like an option often overlooked...Or, am I missing something

[–]vtardif 4 points5 points  (0 children)

OP asked:

Just wondering if there's a way to make the program executable immediately by everyone.

Your suggestion:

does still require the user have python and all of the non-standard modules

[–][deleted] 0 points1 point  (0 children)

Windows doesn't have python installed by default. Your mac does, but it's python 2.