> ## Documentation Index
> Fetch the complete documentation index at: https://hoopdev-update-to-meta-tags.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Python Scripts

> Execute Python scripts using hoop.dev

## Prerequisites

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

* Either [create an account in our managed instance](https://use.hoop.dev) or [deploy your own hoop.dev instance](/getting-started/installation/overview)
* You must be your account administrator to perform the following commands

## Configuration

```bash
hoop admin create conn python3 -- python3
```

## Connect It

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

```bash
hoop exec python3 -i 'import os; print(os.environ)'
```

```bash
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

```bash
hoop exec python3 -- /tmp/myscript.py
```

### Interactive Session

```bash
$ 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.
>>>
```
