shell rerouting

Anders Hammarquist iko at cd.chalmers.se
Thu Feb 13 03:29:49 EST 2003


In article <mailman.1045105796.28580.python-list at python.org>,
Dave Harrison  <dave at nullcube.com> wrote:
>Im looking to take input at the command line (a password) but I dont
>want the input to either be visible, or to enter the shell logs.

I'm not shure whether you want to:

a) Have the user type an invisible password at your program.
   In which case you want getpass.getpass()

or

b) Have your program type a password at some other program.
   In which case your easiest route is probably to use
   expect. There appears to be a Python equivalent at
   http://pexpect.sourceforge.net/

/Anders

-- 
 -- Of course I'm crazy, but that doesn't mean I'm wrong.
Anders Hammarquist                                  | iko at cd.chalmers.se
Physics student, Chalmers University of Technology, | Hem: +46 31 88 48 50
G|teborg, Sweden.           RADIO: SM6XMM and N2JGL | Mob: +46 707 27 86 87




More information about the Python-list mailing list