SecureCRT自動(dòng)上傳文件python腳本
本人在ubuntu下使用SecureCRT,上傳文件習(xí)慣用rz命令。每次上傳都彈對(duì)話框選擇文件按確定后才上傳,感覺(jué)很費(fèi)力。最后自己摸索整理出一個(gè)腳本。
使用方法是,在【Script】菜單點(diǎn)【Run...】 然后選擇這個(gè)腳本【Run】就可以自動(dòng)上傳了。挺方便的~
# $language = "python" # $interface = "1.0" def Main(): crt.Screen.Synchronous = True crt.Screen.Send("rm -rf demofile\n") # 先刪除舊文件 crt.Screen.WaitForString("[xxx@linux xx]$ ") crt.FileTransfer.AddToZmodemUploadList("/your_path/bin/demofile") # 添加文件到上傳列表 crt.FileTransfer.ZmodemUploadAscii = True # 加了這個(gè)執(zhí)行rz時(shí)就不會(huì)彈選擇文件對(duì)話框了。 crt.Screen.Send("rz\n") crt.Screen.WaitForString("[xxx@linux xx]$ ") crt.FileTransfer.ZmodemUploadAscii = False # 設(shè)置調(diào)回來(lái) Main()
技術(shù)還是比較弱渣啊~~~不會(huì)用那些tmux



浙公網(wǎng)安備 33010602011771號(hào)