How to respond to a confirmation prompt automatically
firefoxxer at gmail.com
Sat Jan 13 00:23:46 CET 2007
Rob Wolfe wrote:
> "Coby" <firefoxxer at gmail.com> writes:
> > Just to give you some background about my problem:
> > I execute os.system(command), where command is a string.
> > On the command line in windows, I get:
> > "Continue, and unload these objects? [no]"
> > I need to respond 'y' to continue, but I am uncertain on how to output
> > the 'y' automatically.
> You need to use pipe.
> p = os.popen(command, "w")
> from subprocess import Popen, PIPE
> p = Popen(command, shell=True, stdin=PIPE)
More information about the Python-list