[Python-ideas] String interpolation: environment variables, command substitution
Brendan Barnwell
brenbarn at brenbarn.net
Wed Aug 26 21:27:12 CEST 2015
On 2015-08-26 11:20, Mike Miller wrote:
> One of the remaining questions for the string interpolation subject is whether
> to allow for easy access to environment variables and output-capture of external
> processes (aka command-substitution) as bash does.
You can already do this with the existing proposals by interpolating an
expression whose value is an environment variable (e.g., 'My home is
{os.environ["HOME"]}') or whatever other data you want to interpolate.
There's no reason to add special syntax for this.
--
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is no
path, and leave a trail."
--author unknown
More information about the Python-ideas
mailing list