python expect 2020-01-10 11:05:44 浏览数 (2) 代码语言:javascript复制#!/usr/bin/python import pexpect foo = pexpect.spawn('passwd mqjia') foo.expect("New UNIX password:") foo.sendline("1234567") foo.expect("Retype new UNIX password:") foo.sendline("1234567") foo.interact() python expect 0 人点赞 上一篇:分享雷军22年前编写的代码