Menu

Elfiluke.sh
📰

Elfiluke.sh

DEV Community·llocustjr-web·11 days ago
#GAa637KS
#dev#venv_python#script_path#python#python3
Reading 0:00
15s threshold
Cover image for Elfiluke.sh

llocustjr-web

!/usr/bin/env bash

set -euo pipefail

Replace with your actual virtual environment, Conda env, or Python binary path

VENV_PYTHON="/path/to/venv/bin/python3"

Examples:

VENV_PYTHON="$HOME/.venvs/myenv/bin/python3"

VENV_PYTHON="/opt/conda/envs/myenv/bin/python3"

if [[ $# -lt 1 ]]; then
echo "Usage: $0

SCRIPT_PATH="$1"
shift

if [[ ! -x "$VENV_PYTHON" ]]; then
echo "Error: Python interpreter not executable at $VENV_PYTHON" >&2
exit 1
fi

if [[ ! -f "$SCRIPT_PATH" ]]; then
echo "Error: Python script not found at $SCRIPT_PATH" >&2
exit 1
fi

"$VENV_PYTHON" -- "$SCRIPT_PATH" "$@"