How to use Environment Variables In Python
You can pass environment variables to your scripts by setting them in your shell before running the script:
export MY_VARIABLE=value
poetry run my_script
Script management with Python Poetry
Poetry is a tool that makes it easier to manage Python dependencies and packages and create virtual environments for a project, as well as to package and distribute Python libraries. Apart from dependency management, script management is also one of the strong features of Poetry where developers can define and run scripts in their projects easily. In this article, you will learn the following about how to work with scripts when using Poetry, Setting up and configuring scripts in Python projects, and using scripts with Poetry.