popen2 + passwd
Bryan Fordham
bfordham at piratech.net
Mon May 15 16:20:29 EDT 2000
-----BEGIN PGP SIGNED MESSAGE-----
On 15 May 2000 19:41:59 GMT, garabik at melkor.dnp.fmph.uniba.sk.spam (Radovan
Garabik) wrote:
>Jp Calderone <exarkun at flashmail.com> wrote:
> : Can anyone tell me why this doesn't work?
>
> : import popen2
>
> : i, o = popen2.popen2('passwd bin')
> : pwd = '12345ASD'
> : o.write(pwd + '\n')
> : o.write(pwd + '\n')
> : i.close()
> : o.close()
Try calling o.flush() after sending the first pwd. The information in the
pipe isn't actually written until you close it, or until it's flushed.
HTH
- --B
-----BEGIN PGP SIGNATURE-----
Version: N/A
iQCVAwUBOSBb8w2B1TBOdblFAQHcJgP9HwEQAH4LVxGfXg6LhkrksFA2BEwG7Dtr
X84E2hC1nBjVzfSIJGVKI9Hk1CLaXWJXvW9lQ12kAkdgXzQq05nDCF8QRgU4XBHq
aQq5X8147Jb543SqzzaG/RNVL6PdmHFClTX7R5eS+PY4zhz1jF/PwGTXEbrkdYom
Rs2KIY9nR5E=
=9/Kb
-----END PGP SIGNATURE-----
More information about the Python-list
mailing list