How to respond to a confirmation prompt automatically
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. Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list
Re: How to respond to a confirmation prompt automatically
Thanks Rob. Rob Wolfe wrote: > "Coby" <[EMAIL PROTECTED]> 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. > > 1. > > p = os.popen(command, "w") > p.write("y\n") > > http://docs.python.org/lib/os-newstreams.html#os-newstreams > > 2. > > from subprocess import Popen, PIPE > p = Popen(command, shell=True, stdin=PIPE) > p.stdin.write("y\n") > > http://docs.python.org/lib/module-subprocess.html > > -- > HTH, > Rob -- http://mail.python.org/mailman/listinfo/python-list
Re: Hax's Edu Corner: the bug-trolling attitude
"Hax Eel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The Bug-Trolling Attitude > > Hax Eel, 2006-01-02 > > People, > > There is a common behavior among people in software geek forums, that > whenever a software is crashing or behaving badly, they respond by writing > stupid essays about it and cross-post it to multiple newsgroups as if it > is the duty of Usenet readers to suffer through their egocentric rantings. ... > > This post is archived at: > http://www.trolling-for-you.org/FullOfCrap_dir/crap/bug_trolling_attitude.html That link didn't work for me. {8-o -- Coby Beck (remove #\Space "coby 101 @ bigpond . com") -- http://mail.python.org/mailman/listinfo/python-list