[Python-ideas] String interpolation: environment variables, command substitution

Nick Coghlan ncoghlan at gmail.com
Sat Aug 29 06:50:20 CEST 2015


On 27 August 2015 at 05:44, Mike Miller <python-ideas at mgmiller.net> wrote:
> True, though less readable I think.  If we're going to go as far as
> arbitrary expressions, let's discuss making very common scripting tasks
> easier.

There's already a way to make common scripting tasks easy: use the
preferred shell for your preferred platform.

That said, if anyone really wants to advance the state of the art in
Python's "embedded shell scripting" capabilities, then I'd highly
recommend exploring Julia's capabilities in that area and seeing how
to produce a comparable system using runtime processing of strings in
Python: http://julia.readthedocs.org/en/latest/manual/running-external-programs/

Combining a system like that with f-strings (and/or i-strings) would
then allow ready interpolation of Python variables into command lines
using either *nix or Windows appropriate syntax.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list