zoukankan      html  css  js  c++  java
  • SecureCRT自动上传文件python脚本

    本人在ubuntu下使用SecureCRT,上传文件习惯用rz命令。每次上传都弹对话框选择文件按确定后才上传,感觉很费力。最后自己摸索整理出一个脚本。

    使用方法是,在【Script】菜单点【Run...】 然后选择这个脚本【Run】就可以自动上传了。挺方便的~

    # $language = "python"
    # $interface = "1.0"
    
    def Main():
        crt.Screen.Synchronous = True
        crt.Screen.Send("rm -rf demofile
    ") # 先删除旧文件
        crt.Screen.WaitForString("[xxx@linux xx]$ ")
    
        crt.FileTransfer.AddToZmodemUploadList("/your_path/bin/demofile") # 添加文件到上传列表
        crt.FileTransfer.ZmodemUploadAscii = True # 加了这个执行rz时就不会弹选择文件对话框了。
    
        crt.Screen.Send("rz
    ")
        crt.Screen.WaitForString("[xxx@linux xx]$ ")
        crt.FileTransfer.ZmodemUploadAscii = False # 设置调回来
    
    Main()

    技术还是比较弱渣啊~~~不会用那些tmux

  • 相关阅读:
    3、生成证书请求文件
    2、申请苹果App ID
    登录iOS Dev Center
    SQL Server 合并行
    asp 月末 月初
    linux
    ASP数组全集,多维数组和一维数组[转]
    oracle 秒
    oracle 存储过程 包 【转】
    linux
  • 原文地址:https://www.cnblogs.com/highend/p/securecrt_auto_upload_file_by_python.html
Copyright © 2011-2022 走看看