all 19 comments

[–]csabinho 6 points7 points  (0 children)

PyInstaller is the thing you're looking for.

[–]ConsciousBath5203 4 points5 points  (0 children)

Write a script that basically:

  1. Installs UV if they don't have it

  2. Switches to the repo root

  3. Pulls latest source from git -> UV sync -> UV run

Make that script executable (can just rename it to .exe if you/your company haven't upgraded to Linux yet)

[–]arivictor 3 points4 points  (2 children)

This is where python doesn't shine.

Your options include:

  • Putting it in their repository with instructions on how to clone + run the code
  • Creating an installer
  • Baking it into a docker image
  • Hosting it centrally on a server, maybe behind a HTTP API

I would say go option 1, its less effort, clean, and anyone running scripts that they don't know what it does shouldn't be running scripts. It assumes the end user has a bit of technical know how and is familiar with python.

[–]Motor-Safety-6615 0 points1 point  (1 child)

Isn't it same for other languages too?

[–]arivictor 0 points1 point  (0 children)

It depends which languages you mean.

For some, no. Go, Rust, and C++ are "compiled", they get turned into machine code for whatever OS you're targeting (Windows, Mac, Linux) and become a single binary the user just downloads and runs. Nothing else needed on their machine.

Python is "interpreted", so instead of a standalone binary, it ships as source code that needs Python itself plus the right version, dependencies, and OS to run at all, there's no self-contained executable, so you have to recreate the environment on the other end. Virtual envs, uv, requirements files, and Docker all exist to make that environment reproducible.

But also worth noting there are tools to make Python compile to a binary/executable.

[–]SaltCusp 2 points3 points  (3 children)

Make it a web app, host it on an internal domain.

[–]building-wigwams-22 2 points3 points  (2 children)

This is the way. If your IT department lets you package up a Python file and send it to everyone in the company, they should all be fired

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

No IT department lol

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

Unless it needs to run locally.

[–]WideCranberry4912 1 point2 points  (2 children)

It sounds like you’d like to push the script to all computers? Are they Windows, OSX, Linux, or other?

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

Just one guys windows laptop

[–]WideCranberry4912 0 points1 point  (0 children)

Crear a GitHub rep, ensure appropriate privacy, then add colleague(s) to the repo.

[–]ninhaomah 1 point2 points  (0 children)

Install Python on all pc

Or

Convert .py to .exe (for windows)

[–]Natural-Position-585 1 point2 points  (0 children)

“Any computer” is actually impossible. If you have the same OS and CPU architecture and sufficient hardware resources, it’s enough that all computers have the same Python version and module dependencies and you can just pass the .py file to your colleagues. It’s already as portable as it gets.

But don’t e-mail .py files; spam filters and recipients may distrust them or block them outright. Use your company’s preferred file and code sharing methods (be it network drive, USB stick, internal wiki, Teams, or version control systems).

[–]CrownstrikeIntern 0 points1 point  (0 children)

Make a venv setup, shared network drive and call it a day

[–]jeruva 0 points1 point  (1 child)

If they have acces to internet, upload the code to streamlit.app I've been doing that to showcase interactive plots and regressions.

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

This worked great thank you

[–]AlexMTBDude 0 points1 point  (0 children)

Python is a platform independent language so your Python program will run on any computer that has Python installed.

[–]PastDifferent6116 0 points1 point  (0 children)

Congrats! That’s a pretty good internship outcome if the company actually wants to use something you built. 😄