I want to communicate with a data-logger via Telnet. Therefore, I wrote the following python-script:
import subprocess
command ='plink.exe -telnet -P 23 12.17.46.06'
p = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, bufsize=1, shell=False)
answer = p.communicate('command')[0]
print answer
By running the script, a plink-windows pops up. The python script seems to wait for some action to be done inside the plink command window. By closing the window manually, the desired "answer" shows up inside python.
I am looking for a command / procedure to close plink directly out of python. It seems not to be sufficient to just close the subprocess, as in this case only the communication between python and plink gets closed and not the program plink.exe itself.
Any help is appreciated! Regards, Phil