Skip to content

Instantly share code, notes, and snippets.

@petergloor
Created February 17, 2026 14:23
Show Gist options
  • Select an option

  • Save petergloor/f76ae437b53d047b8e0b8a5498c3e51e to your computer and use it in GitHub Desktop.

Select an option

Save petergloor/f76ae437b53d047b8e0b8a5498c3e51e to your computer and use it in GitHub Desktop.
python_helpers

A fiew helpers related to Python 3

Get path to actual dist-packages

python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"

Get Python Version major.minor (e.g. 3.12)

python3 -c "import sys; sa=[str(sys.version_info.major),str(sys.version_info.minor)]; print('.'.join(sa))"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment