> ## Documentation Index > Fetch the complete documentation index at: https://pipedream.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # Python export const PYTHON_VERSION = '3.12'; Pipedream supports [Python v{PYTHON_VERSION}](https://www.python.org) in workflows. Run any Python code, use any [PyPI package](https://pypi.org/), connect to APIs, and more. ## Adding a Python code step 1. Click the + icon to add a new step 2. Click **Custom Code** 3. In the new step, select the `python` language runtime in language dropdown ## Python Code Step Structure A new Python Code step will have the following structure: ```python theme={null} def handler(pd: "pipedream"): # Reference data from previous steps print(pd.steps["trigger"]["context"]["id"]) # Return data for use in future steps return {"foo": {"test": True}} ``` You can also perform more complex operations, including [leveraging your connected accounts to make authenticated API requests](/workflows/building-workflows/code/python/auth/), [accessing Data Stores](/workflows/building-workflows/code/python/using-data-stores/) and [installing PyPI packages](/workflows/building-workflows/code/python/#using-third-party-packages). * [Install PyPI Packages](/workflows/building-workflows/code/python/#using-third-party-packages) * [Import data exported from other steps](/workflows/building-workflows/code/python/#using-data-from-another-step) * [Export data to downstream steps](/workflows/building-workflows/code/python/#sending-data-downstream-to-other-steps) * [Retrieve data from a data store](/workflows/building-workflows/code/python/using-data-stores/#retrieving-data) * [Store data into a data store](/workflows/building-workflows/code/python/using-data-stores/#saving-data) * [Access API credentials from connected accounts](/workflows/building-workflows/code/python/auth/) ## Logging and debugging You can use `print` at any time in a Python code step to log information as the script is running. The output for the `print` **logs** will appear in the `Results` section just beneath the code editor. ## Using third party packages