[Python-ideas] shutil.runret and shutil.runout

Nick Coghlan ncoghlan at gmail.com
Fri Feb 24 13:19:07 CET 2012


On Fri, Feb 24, 2012 at 10:13 PM, Mike Meyer <mwm at mired.org> wrote:
> How about adding your new function to subprocess, except instead of
> passing them to the shell, they use shlex to parse them, then call
> Popen with the appropriate arguments? shlex might need some work for
> this.

http://shell-command.readthedocs.org

>>> from shell_command import shell_call
>>> shell_call("ls *.py")
setup.py  shell_command.py  test_shell_command.py
0
>>> shell_call("ls {}", "*.py")
ls: cannot access *.py: No such file or directory
2
>>> shell_call("ls {!u}", "*.py")
setup.py  shell_command.py  test_shell_command.py
0

Unless someone uncovers a major design flaw in the next few months, at
least ShellCommand, shell_call, shell_check_call and shell_output are
likely to make an appearance in subprocess for 3.3.

Cheers,
Nick.

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



More information about the Python-ideas mailing list