← Back to context

Comment by mr_toad

2 months ago

I love scripting in Python too. I just hate trying to install other people’s scripts.

> hate trying to install other people’s scripts.

This phrasing sounds contradictory to me. The whole idea of scripts is that there's nothing to install (besides one standard interpreter). You just run them.

  • By that logic, you don't install an OS, you just put the bootloader and other supporting files on your storage medium of choice and run it

  • > The whole idea of scripts is that there's nothing to install

    and yet without fail, when I try to run basically any `little-python-script.py`, it needs 14 other packages that aren't installed by default and I either need to install some debian packages or set up a virtual environment.

    • Its up to the programmer whether they use external packages or not. I dont ser the problem with setting up a venv, but if this is packaged correctly you could do uv run.

      1 reply →

Anytime I have the need to write a script, I write it myself. When I do this, I like to do it in Python, rather than Go.

I very rarely, if ever, “install” or run other people’s scripts. Because typically, a script is a specialized piece of code that does something specific the user was trying to do when they wrote it.

However, I do often install applications or libraries written by other people in Python. Typically, I don’t have a problem, but sometimes I run into dependency hell. But this is something different than me just writing scripts. For scripting, Python is great.

If they use https://packaging.python.org/en/latest/specifications/inline... then it becomes a breeze to run with uv. Not even a thing.

  • but then you need uv

    it's not as portable

    • Inline script metadata itself is not tied to uv because it's a Python standard. I think the association between the two comes from people discovering ISM through uv and from their simultaneous rise.

      pipx can run Python scripts with inline script metadata. pipx is implemented in Python and packaged by Linux distributions, Free/Net/OpenBSD, Homebrew, MacPorts, and Scoop (Windows): https://repology.org/project/pipx/versions.

      5 replies →

> I just hate trying to install other people’s scripts.

This notion is still strange to me. Just... incompatible with how I understand the term "script", I guess.

  • You don't understand the concept of people running software written by other people?

    One of my biggest problems with python happens to be caused by the fact that a lot of freecad is written in python, and python3 writes _pycache_ directories everywhere a script executes (which means everywhere, including all over the inside of all my git repos, so I have to add _pycache_ to all the .gitignore ) and the env variable that is supposed to disable that STUPID behavior has no effect because freecad is an appimage and my env variable is not propagating to the environment set up by freecad for itself.

    That is me "trying to install other people's scripts" the other people's script is just a little old thing called FreeCAD, no big.

    • > That is me "trying to install other people's scripts" the other people's script is just a little old thing called FreeCAD, no big.

      What I don't understand is why you call it a "script".

      > and python3 writes _pycache_ directories everywhere a script executes (which means everywhere, including all over the inside of all my git repos, so I have to add _pycache_ to all the .gitignore )

      You're expected to do that anyway; it's part of the standard "Python project" .gitignore files offered by many sources (including GitHub).

      But you mean that the repo contains plugins that FreeCAD will import? Because otherwise I can't fathom why it's executing .py files that are within your repo.

      Anyway, this seems like a very tangential rant. And this is essentially the same thing as Java producing .class files; I can't say I run into a lot of people who are this bothered by it.

      3 replies →

    • I wouldn't use "script" to describe FreeCAD. Regardless, this problem is much more with FreeCAD than with Python.

      > I have to add _pycache_ to all the .gitignore

      I just add that, once, in my global gitignore.