Python is great for something I will use myself, but not so great for when I want someone else to use my code.
Python is great for something I will use myself, but not so great for when I want someone else to use my code.
If I give somebody a binary, I have to compile this binary for their operating system and architecture. If they don't know how to program they'll be confused as to why they cannot share this program with others.
If I share somebody a python script, they can still execute it as a program as long as a shebang is set. They can use this script on any operating system and can open it with at text editor to view it's inner workings.
This makes scripting languages like Python much more accessible for single-file scripts.
As long as they have the right version of Python and all of your program's dependencies installed, which they most likely won't.
> They can use this script on any operating system and can open it with at text editor to view it's inner workings.
Someone who doesn't know how to program most likely isn't going to be using multiple operating systems and isn't going to want to open the script in a text editor to view its inner workings.
I agree with the parent comment that distributing binaries is way more seamless when your users are not very technical.
The venv created for this is ephemereal (it can not be if you want), so you don't need to keep in mind cleaning up stuff and so. Also uv is really fast in creating the venv and installing whatever is needed. Coming from using plain pip and venvs (and having pain setting up different python version interpreters for projects), and poetry just after that, I am pretty happy with the improvements.
The equivalent things in Go, Rust, etc are a breath of fresh air for sure
I'm not familiar with Python, but I presume its similar to Ruby, where besides trivial scripts, this is false - as soon as there are libraries required, you need to find a way to handle them, which in some cases may include handling multiple envs (I write and distributes such scripts).
Compiling for multiple environments in a controlled environment is by far much more convenient than debugging scripts failing on end users' systems.
Since when has windows come with python installed and worked with a shebang?
Mac OS doesn't come with python installed and clicking it won't run it.
So anyone " confused as to why they cannot share this program with others." isn't going to be able to use your python script.
As they may not have same python version, may have different python libraries (version)
It's not simple to run a python script specially one which uses libraries (let's be honest how often your core is not using those popular libraries)
Not if you use any libraries.
Considering how widespread Python is it seems like solving the one-executable problem for Python should be easier than solving Rust’s problem (heavy compilation). Like with a wrapper or something.
That someone is too lazy to do so is not Python's problem, that's their problem.
It's much simple to write scripts in Go.
Here's an example; https://github.com/zerocorebeta/bashlike