Well, your literal code won t work. You are passing a string with the value PathToCygwin and that isn t going to do anything. I assume that you are passing a better string than that, but you didn t show us what.
I think your PathToCygwin is probably the problem. If you don t get the path right, it won t work.
Here is my test code. I ran this under the Cygwin version of Python, so I used a Cygwin-style path: instead of r"C:cygwininash.exe"
I used a /cygdrive/c
path:
>>> cpath = "/cygdrive/c/cygwin/bin/bash.exe"
>>> cygwin = subprocess.Popen(cpath,shell=False,stdin=subprocess.PIPE,stdout=su
bprocess.PIPE)
>>> cygwin.stdin.write("ssh")
>>>
Again, I ran this in the Cygwin-compiled version of Python. If you are using the Windows native version of Python, you will probably need to use a C:
path.
If you still are having trouble, would you please tell us exactly which version of Python you are using, and show us the actual path code you are using?