[Python] python script to open tera term application and sending keys

Discussão em 'Python' iniciado por Stack, Junho 20, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to use Python script to run Tera Term application to open console for Serial port communication and i am sending some commands/keys like {Enter} key on tera term . but my script dosen't work. Heres the script -

    import os
    import win32com.client
    shell = win32com.client.Dispatch("WScript.Shell")
    shell.Run("C:\\Program Files (x86)\\teraterm\\ttermpro.exe")
    shell.AppActivate("COM1:57600baud - Tera Term VT")
    shell.SendKeys("{Enter}")


    i am using python2.7 on my windowxp Pc. please help me with this i am new to python . please help me out

    Continue reading...

Compartilhe esta Página