How to use Secrets with Python custom code automation

How can I access secrets in a python custom code element? The example given is in js…

Hey, @anewhubspotuser :waving_hand: Thanks for reaching out. Can you link us to the specific page and example you are referring to, please?
I found some resources to help get us started:

Thank you for the additional information! — Jaycee

I am referring to Workflows | Custom Code Actions - HubSpot docs . There is only a js example for handling secrets.

HubSpot has it in their documentation under the Get Started section in the Python code example, but when I used their code it didn’t work. I tried the below code and you can access a secret using it.
Replace SECRET_KEY in the code with your own.

import os
from hubspot import HubSpot

def main(event):
 api = os.environ.get('SECRET_KEY')