Updating Python Gateway Code
The Python Gateway described in earlier versions of this document is only available on InterSystems IRIS version 2020.3. It is an older version of the technology now implemented in InterSystems External Servers, which support Java and .NET as well as Python. See Using InterSystems External Servers for full details.
Your Python Gateway code will work on the new External Servers with only minor modifications. Proxy objects still work exactly as they do in the Python Gateway. The main difference is the new $system.external interface, which makes connecting to a Python External Server and obtaining a Python proxy object much simpler. For example, the following ObjectScript code creates a Python gateway, defines the path to the desired Python class, automatically starts the connection, and creates a new proxy object:
set gateway = $system.external.getPythonGateway() do gateway.addToPath("C:\Dev\SomeClasses.py") set proxy = gateway.new("SomeClasses.ClassOne")
The proxy object will continue to work exactly as it did in the old Python Gateway. See the section on “Upgrading Object Gateway Code” in Using InterSystems External Servers for more examples.