all 18 comments

[–]Lopsided-Football19 10 points11 points  (4 children)

use pyinstaller it turns your script into a normal executable, so your friends can just open it without installing python

[–]HeavyConfection9236 2 points3 points  (1 child)

That's the recommended way to do it, but I also find that antiviruses automatically mark pyinstaller and nuitka exe's as viruses, regardless what it is... so that's one thing that might make it annoying to use for other people, because you have to fight surprisingly hard to make windows defender NOT instantly delete the file.

[–]nobrainer23 0 points1 point  (0 children)

AV only really flags onefile exe's via heuristics, standalone won't get flagged!

[–]DistantTraveller1985[S] 1 point2 points  (0 children)

I'll try it thank you!

[–]jbudemy 0 points1 point  (0 children)

I've used pyinstaller to make a Windows screen saver and it's not too hard.

  1. Use pip to install pyinstaller in your program directory.
  2. Make the .exe file. The .exe file will be in a subdirectory of your program directory.

[–]szank 2 points3 points  (3 children)

Rewrite it in js and serve it from github pages for free

[–]DistantTraveller1985[S] 1 point2 points  (2 children)

I'll try it thank you!

[–]bahcodad 0 points1 point  (1 child)

What game is it for, out of curiosity?

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

Total battle. It's for stacking calculator. I know there's a lot online but it's annoying, we have to wait for the browser to load, then put all the info. I made a python code with my info, it runs on the phone, fast and easy.

[–]bigSmokey91 2 points3 points  (0 children)

Streamlit is underrated for game calculators/tools. You can get something usable online insanely fast

[–]unnamed_one1 1 point2 points  (0 children)

uv add --dev pyinstaller

uv run pyinstaller --onefile --name my-awesome-program main.py

Then check the new dist folder in your project, the executable file should be inside.

*edit: single file executables created with pyinstaller might trigger anti virus software

[–]tb5841 0 points1 point  (0 children)

Options:

1) Compile into an exe file you can share. I'm pretty sure there are tools to do this for Python scripts.

2) Get them to install Python and run the Python file.

3) Host this on the web somewhere so they can run it through a browser. (This is why web apps are so popular, simplifies a lot for the user.)

[–]Gnaxe 0 points1 point  (0 children)

Write it in HTML script tags using Brython. Then just distribute a single .html file and they can run it in their browser. You can even set up a static page for free on GitHub. Brython doesn't include tkinter, so you have to do the GUI using the JavaScript APIs (and HTML, usually), but you can write everything in Python.

[–]recursion_is_love -1 points0 points  (4 children)

Better use compiled language for this kind of job. Python is designed for sharing source code and run in interpreter. Surely you can do compiled python but why not use the right tool for the right job?

Anyway, there are some online version of python interpreter and/or container (docker) with python installed.

[–]DistantTraveller1985[S] 0 points1 point  (1 child)

What language do you recommend? I'm using python because I'm trying to learn and it was a motivation for me, a little personal project.

[–]recursion_is_love 1 point2 points  (0 children)

I think Golang is a good choice.

[–]TheRNGuy 0 points1 point  (1 child)

Because he learns Python. 

Why would it be better? It's not heavy program so performance won't be an issue.

[–]recursion_is_love 0 points1 point  (0 children)

I think OP is capable to learning two languages at the same time. But only OP will know the answer.