'Automating RealTerm with Python

I am currently in the process of creating a script to automate RealTerm. I need to send a binary file and have the Winsock setting set to "Raw". RealTerms documentation indicates that I need an integer 0 or 1 for this setting but I am receiving a "object has no attribute" "Winsock".

RT.Winsock = 0 is what I currently have it set at. This this is the error message I get. '<win32com.gen_py.Realterm Library.IRealtermIntf instance at 0x1826368502752>' object has no attribute 'Winsock' Could this be a bug in the program?

I have also tried RT.Winsock = ("0") and that returned the same error but that sets it as a string and not integer.

Any thoughts on how it should be set or what I'm doing wrong? Here is my full error below.

Exception has occurred: AttributeError '<win32com.gen_py.Realterm Library.IRealtermIntf instance at 0x2390257155040>' object has no attribute 'Winsock'

During handling of the above exception, another exception occurred:

File "C:\NetworkUpdater\NUP\NUPv1.0.py", line 13, in module RT.Winsock = 0

Edit: Added code below

RT = DispatchEx("Realterm.RealtermIntf")
RT.Visible = True
RT.Caption = "Realterm Controlled from Python"
RT.SelectTabSheet("Port")
RT.Winsock = 0


Solution 1:[1]

I was never able to get RT.Winsock to properly work or even use the DoCommands due to lack of examples even though it was in the documentation.

But I was able to resolve this issue and get the Wisock setting to Raw by setting WINSOCK=0 in a INI file that gets called upon startup of realterm.exe

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mitchell