0

I am trying to launch a PuTTY window that establishes a serial connection, and then have the main cmd window (the one that launched my Python script) control the PuTTY window. The PuTTY window will still be open and showing everything, but I want to disable the stdin on it and just have it get the input from the cmd shell.

So I have it successfully launching the PuTTY window, just cant seem to pipe my outputs and inputs like I want. Any help would be greatly appreciated!

Code for launching PuTTY window:

pty=subprocess.Popen(cmd,stdin=subprocess.PIPE,stdout=subprocess.PIPE)
Suncatcher
  • 10,355
  • 10
  • 52
  • 90
user3528365
  • 47
  • 2
  • 9
  • 3
    you cant really do that ... you might want to come up with another method (ie just using `serial.serial`) and displaying it .... why putty? that seems like a very strange choice – Joran Beasley Feb 04 '15 at 00:23

2 Answers2

3

PuTTY is a GUI application. It is not designed for automation.

For automation, use the Plink, PuTTY command-line utility. It is a console application, so it reads commands from its standard-input.

See:

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
0

PuTTY (note case) is a GUI program and has nothing what so ever to do with cmd prompts.

I use PuTTY all day and out of a lot of people (my coy has 175,000 employees but most wouldn't use PuTTY) I'm the only one that automates it. I use VBScript sendkeys bound to hotkeys in windows shortcuts (must be on desktop or start menu).

PuTTY does have a command line version with a similar name, but I've not used it.

Serenity
  • 68
  • 3