标签:os 使用 sp bs as line nbsp br file
__author__ = ‘jenny‘
import pexpect
ip="localhost"
user="jenny"
passwd="gaoxing"
if __name__=="__main__":
child = pexpect.spawn("ssh-keygen")
print child.expect("Enter file*")
child.sendline()
try:
child.expect("Overwrite*", timeout=3)
child.sendline()
except:
pass
print child.expect("Enter passphrase*")
child.sendline()
print child.expect("Enter same passphrase*")
child.sendline()
标签:os 使用 sp bs as line nbsp br file
原文地址:http://my.oschina.net/1987times/blog/356837