logo

Python πŸŽ₯

Execute scripts with Hoop connections

Allows executing one-off scripts using the underlying Operating System tools.

Connection Command

plain text
python3
:::info note This mode requires the agent running on top of a Linux that has the python3 runtime. :::

How to Use

Now it’s possible to execute python scripts straight from Hoop
plain text
hoop exec python3-prod -i 'import os; print(os.environ)' # asumming the runtime has the boto3 dependency installed hoop exec python3-prod <<EOF s3 = boto3.client('s3') response = s3.list_buckets() print('Existing buckets:') for bucket in response['Buckets']: print(f' {bucket["Name"]}') EOF
It’s possible to start an interactive session with pyhon
plain text
hoop connect python3-prod
Calling scripts are easy too
plain text
hoop exec python3-prod -- /tmp/myscript.py

Powered by Notaku