Python
Welcome to the Python community on the programming.dev Lemmy instance!
π Events
Past
November 2023
- PyCon Ireland 2023, 11-12th
- PyData Tel Aviv 2023 14th
October 2023
- PyConES Canarias 2023, 6-8th
- DjangoCon US 2023, 16-20th (!django π¬)
July 2023
- PyDelhi Meetup, 2nd
- PyCon Israel, 4-5th
- DFW Pythoneers, 6th
- Django Girls Abraka, 6-7th
- SciPy 2023 10-16th, Austin
- IndyPy, 11th
- Leipzig Python User Group, 11th
- Austin Python, 12th
- EuroPython 2023, 17-23rd
- Austin Python: Evening of Coding, 18th
- PyHEP.dev 2023 - "Python in HEP" Developer's Workshop, 25th
August 2023
- PyLadies Dublin, 15th
- EuroSciPy 2023, 14-18th
September 2023
- PyData Amsterdam, 14-16th
- PyCon UK, 22nd - 25th
π Python project:
- Python
- Documentation
- News & Blog
- Python Planet blog aggregator
π Python Community:
- #python IRC for general questions
- #python-dev IRC for CPython developers
- PySlackers Slack channel
- Python Discord server
- Python Weekly newsletters
- Mailing lists
- Forum
β¨ Python Ecosystem:
π Fediverse
Communities
- #python on Mastodon
- c/django on programming.dev
- c/pythorhead on lemmy.dbzer0.com
Projects
- PythΓΆrhead: a Python library for interacting with Lemmy
- Plemmy: a Python package for accessing the Lemmy API
- pylemmy pylemmy enables simple access to Lemmy's API with Python
- mastodon.py, a Python wrapper for the Mastodon API
Feeds
You should use python3
anyway not python
. The latter is sometimes Python 3, sometimes Python 2 and sometimes doesn't exist. python3
works reliably, assuming you have it installed.
(And assuming you aren't using the official Windows Python installer, but that doesn't seem like the case here!)
I ended up adding Python3 as it moaned when I just added Python. Thank you so much for your advice though. I'm grateful.
In addition to what everybody said:
- use bash strict mode
- use shellcheck
Those will help catch many problems before they happen or exactly when they happen.
P.S I would recommend against
set -o pipefail
It can introduce some very weird behaviour when it doesn't work.
Could you elaborate on the weird behaviour introduced by pipefail
?
This wiki explains one pitfall of nonstandard return codes in pipes. The other one that bit me is pipes that just stop existing (error 141).
Thanks. Bash should just be avoided except trivial uses. It has an impressive collection of footguns. I've written a lot of bash, even used it for CGI scripts to create web tools, but honestly it is time to move on. Ansible and Python cover most of the bash use cases.
I fully agree with you. Hopefully newer shells will be used for distros (nushell, xonsh, osh, ...). Backwards compatibility with bash is a huge pitfall that should be a disqualification criterion.
Thank you so much. Especially for the Shell Check. That's an invaluable resource.
Python is not found, so $ARCH gets assigned to ""
, and you didn't double quote your variables in the comparison, so the code parses as [ == "aarch64"
which is a syntax error.
Also, maybe uname -m
could work instead of that Python script.
This was super insightful. Thank you so much.
This is a docker/bash question, not a python question. Also reading the error message explains the problem.
Apologies, I thought it was Python because I was trying to execute a Python script. And double sorry for not knowing how to interpret the error message.
Python is not on the Path for docker. The error message "python: command not found" is then passed to the [ command (also called test) which says too many arguments.
Add the path /use/bin/ to your python command. Or figure out why it isn't on the docker path.
Thank you so much.
What is your base image? It has no python installed.
Rust:1.78-bookworm.
Thank you, manually included it.