I'm trying to learn PyCharm, I need to pass an environment variable as a command line parameter for my process, for example. run the equivalent myScript.py -u $myVaron Linux or myScript.py -u %myVar%on Windows.
myScript.py -u $myVar
myScript.py -u %myVar%
How to indicate what is in PyCharm configuration? I do not want my script to depend on the name myVar, only on the contents of this environment variable.
myVar
Many thanks
in PyCharm Run / Debug configuration for "Script Parameters:" Enter
-u ${myVar}
. env. , env. , Run/Debug PyCharm. " "
env- Run/Debug ( @alok-a), , " ". PyCharm 2018.3.4.
, , - python, .
import subprocess # Build params line cmd = ["python", script_path] + params.split() subprocess.run(cmd)
(, script_path).
- . , .
Go to the "Edit Configurations> Environment Variables" section. Add or change.
Source: https://habr.com/ru/post/1540579/More articles:d3.js manual NVD3 trigger hint - javascriptvariable assignment with switch in coffescript - javascriptCreating API documents through code comments - restCannot run shell command via php exec, but can user on shell? - linuxThere are no constant dependencies Yesod - yesodPolymer: how to dynamically import an element - javascriptPolymer: create a "generic" user element - javascriptGet accessible IP address from dhcp server - c #Deploy an existing docker image using Deis - dockerHow to programmatically sign code in a Word document - c #All Articles