[Tutor] Trouble with passing commands / variables to os.system()
David
david at pythontoo.com
Wed Jun 24 02:42:33 CEST 2009
David wrote:
> Charlie Reddington wrote:
>
>>
>> Thanks for all the replies, I'll definitely look into it all.
>>
>> Charlie
>>
>>
> Something else for your consideration;
> http://commandline.org.uk/python/sftp-python-really-simple-ssh/
>
almost forgot pexpect
#!/usr/bin/python
import pexpect
child = pexpect.spawn ('ssh root at localhost')
child.expect ('Password:')
child.sendline ('mypassword')
child.expect ('')
child.sendline ('ls -a')
print child.before
child.interact()
--
Powered by Gentoo GNU/Linux
http://linuxcrazy.com
More information about the Tutor
mailing list