Re: [Tutor] responding to command line

2015-11-25 Thread Patrick Hess
richard kappler wrote:
> and I want the script to detect that password request and provide the
> password (Same for all 500 + machines, so no issue there).

My recommendation would be to take a look at Expect[1].

Yes, I know, it's not Python, but using a tool specifically
tailored to handle this kind of task will make life so much
easier that it even justifies the use of Tcl. ;-)

Patrick

[1] http://expect.sourceforge.net
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] responding to command line

2015-11-25 Thread Patrick Hess
Alan Gauld wrote:
> But there is a python wrapoper round expect - pexpect - that
> means you don't need to learn Tcl ;)
> 
> https://github.com/pexpect/pexpect
 
Interesting, thanks. And better yet, it's not just a wrapper
around Expect: "Pexpect is in the spirit of Don Libes' Expect,
but Pexpect is pure Python." So you don't even have to install
anything Tcl. :-)

On the downside, Windows support seems to be quite limited at
this point. However, if that's not of any concern to Richard,
Pexpect is probably his best option. This example right here
looks like a good starting point:

   https://github.com/pexpect/pexpect/blob/master/examples/passmass.py

I, unfortunately, have to deal with Windows from time to time,
so it's still Tcl for me...

Patrick
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor