Can I execute a shell command that requires input in ipython and/or an ipython notebook?
When I execute such a command, I see it\'s prompt, but no apparent way to p
Sadly, no.
I couldn't find documentation on this, so I went source-diving. The ipython code that actually performs that transformation is https://github.com/ipython/ipython/blob/master/IPython/core/inputtransformer.py#L208 , specifically:
def _tr_system(line_info):
"Translate lines escaped with: !"
cmd = line_info.line.lstrip().lstrip(ESC_SHELL)
return '%sget_ipython().system(%r)' % (line_info.pre, cmd)
which, in other words, invokes the underlying shell with everything following the !
.
ipython is probably not what you want -- check out this answer for a Python alternate to include in scripts.