How to pass an environment variable as a command line parameter in Run/Debug configuration in PyCharm?

后端 未结 3 736
梦如初夏
梦如初夏 2021-01-05 02:02

I am trying to learn PyCharm, need to pass an environment variable as a command line parameter to my process, e.g. execute an equivalent of myScript.py -u $myVar

3条回答
  •  醉梦人生
    2021-01-05 02:09

    in PyCharm Run/Debug configuration for "Script Parameters:" Enter

    -u ${myVar}
    

    Note: This will work only for existing env. variables but not for env. variables that you set up in the PyCharm Run/Debug configuration. For that to work, you will need to look into "Before Launch" configuration

提交回复
热议问题