sparkz_alot - I'm using current version of Python, I had just copied and pasted from old scripts found online to create the script...tried removing the raw, but same outcome.
Wavic - Thanks again for the input. I ran it in a terminal window. It does not appear to me like the Telnet commands are getting processed. It immediately starts typing the PO on the screen and then I have to press the enter key to get it to continue. Then it indicates:
Traceback <most recent call last>:
File "...path to python Scripts folder\aaa.py", line 9, in <module> telnet.write<VSX Command>
File "C:\Program Files\Python36-32\lib\telnetlib.py", line 287, in write if IAC in buffer:
TypeError: 'in <string>' requires string as left operand, not bytes
Here is the current aaa.py script:
import telnetlib
telnet = telnetlib.Telnet()
HOST = "192.168.1.140"
VSXCommand = input("PO")
telnet.open(HOST)
telnet.write(VSXCommand)
telnet.close()
I know its port 23 because I can get it to work using a telnet session from the command prompt...what is strange though, is that if I type telnet from the command prompt and try to do an interactive start, it doesn't work...I have to type telnet 192.168.1.140 to start it off and it works...then I just type PO and the Stereo Receiver turns on and there is some feedback as to the status of the receiver in the telnet session...I press the control key and the ] and it exits and then I type quit and it ends the telnet session, then I type exit to close command prompt.
Thank you again for all of your help! I have probably spent 10 hours trying to figure this out :)
Wavic - Thanks again for the input. I ran it in a terminal window. It does not appear to me like the Telnet commands are getting processed. It immediately starts typing the PO on the screen and then I have to press the enter key to get it to continue. Then it indicates:
Traceback <most recent call last>:
File "...path to python Scripts folder\aaa.py", line 9, in <module> telnet.write<VSX Command>
File "C:\Program Files\Python36-32\lib\telnetlib.py", line 287, in write if IAC in buffer:
TypeError: 'in <string>' requires string as left operand, not bytes
Here is the current aaa.py script:
import telnetlib
telnet = telnetlib.Telnet()
HOST = "192.168.1.140"
VSXCommand = input("PO")
telnet.open(HOST)
telnet.write(VSXCommand)
telnet.close()
I know its port 23 because I can get it to work using a telnet session from the command prompt...what is strange though, is that if I type telnet from the command prompt and try to do an interactive start, it doesn't work...I have to type telnet 192.168.1.140 to start it off and it works...then I just type PO and the Stereo Receiver turns on and there is some feedback as to the status of the receiver in the telnet session...I press the control key and the ] and it exits and then I type quit and it ends the telnet session, then I type exit to close command prompt.
Thank you again for all of your help! I have probably spent 10 hours trying to figure this out :)