我想做一個冗長的操作,但超時參數與pexpect似乎並沒有改變超時異常被觸發前的時間長度。這裏是我的代碼: child = pexpect.spawn('scp file [email protected]:/temp', timeout=300)
whichMatched = child.expect(['(?i)Password','Are you sure you want to con
我正在使用ssh登錄到攝像機,scp tarball並從tarbal中提取文件,然後運行腳本。不過,我和Pexpect有問題。當壓縮包被複制時,Pexpect超時。似乎不等到它完成。然後它開始用untar命令做同樣的事情,我的代碼如下: ssh_newkey = 'Are you sure you want to continue connecting'
copy = pexpect
我想用pexpect ssh到一臺計算機,但我不想返回到原來的計算機。我的代碼是: #!/usr/bin/python2.6
import pexpect, os
def ssh():
# Logs into computer through SSH
ssh_newkey = 'Are you sure you want to continue connecting'