Question
· Jan 2, 2023

Encoding error in Studio output - Embedded Python

 Hello, good afternoon! (or good morning or good evening)
 

I was doing some very basic tests, based on the documentation, using Python in Studio.
I decided to call a python method through the Studio's own terminal as a demonstration, but the result was different from the terminal result:

Code:

Class User.EmbeddedPython
{

// Write ##class(User.EmbeddedPython).Test()
/// Description
ClassMethod Test() As %Status [ Language = python ]
{
    # print the members of the Fibonacci series that are less than 10
    print("Fibonacci series")
    a, b = 0, 1
    while a < 10:
        print(a, end=' ')
        a, b = b, a + b

    # import the iris module and show the classes in this namespace
    import iris
    print("\nInterSystems IRIS classes in this namespace:")
    status = iris.cls('%SYSTEM.OBJ').ShowClasses()
    return status
}

}

Terminal (as expected):

 

Studio:

Class name came out correctly, but what was put in a Python String came out wrong.

I tested the same class on other IRIS installations and the error persisted.


Does anyone know a way to fix this?

Thanks in advance for your attention.

Product version: IRIS 2022.1
$ZV: IRIS for Windows (x86-64) 2022.1.1 (Build 374U)
Discussion (3)1
Log in or sign up to continue