Prerequisites

To get the most out of this guide, you will need to:

Configuration

hoop admin create conn python3 -- python3

Connect It

Now, it’s possible to execute Python scripts straight from hoop.dev.

hoop exec python3 -i 'import os; print(os.environ)'
hoop exec python3 <<EOF
s3 = boto3.client('s3')
response = s3.list_buckets()

print('Existing buckets:')
for bucket in response['Buckets']:
    print(f'  {bucket["Name"]}')
EOF

Execute scripts directly

hoop exec python3 -- /tmp/myscript.py

Interactive Session

$ hoop connect python3
connection: python3 | session: ac8afefe-3d7b-46b1-b905-ed0a65a4b8dc
Python 3.8.10 (default, May 26 2023, 14:05:08)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>