You can set environmental variables in Pycharm’s run configurations menu.
-
Open the Run Configuration selector in the top-right and cick
Edit Configurations...
-
Find
Environmental variables
and click...
-
Add or change variables, then click
OK
You can access your environmental variables with os.environ
import os
print(os.environ['SOME_VAR'])