Hi everyone,

I'm attempting to compile a basic Python code on a remote server, but it appears that the compiler doesn't recognize the language.

The remote server is running a virtual machine with Oracle Linux Server 7.9 (64-bit), and it has IRIS for UNIX (Red Hat Enterprise Linux for x86-64) 2021.1 (Build 215U) [HealthConnect:3.3.0] installed.

When I try to compile a script that includes a Python ClassMethod, such as this "testpy.cls":

0 4
0 150

It is possible to update Cache object property from Python using the following Python code, with import of intersys.pythonbind3:

my_object.set("my_property",["A","B","C"])

However, I am unable to save 2D %List with 2D Python array like the following:

my_object.set("my_property",[["A","B","C"],["1","2","3"]])

I am not sure whether this is Python-Cache bind flaw or design issue. Is there any alternative/ workaround to do the same for above?

0 3
0 359

Pyodbc supports calling stored procedure , but if the IRIS Stored Procedure ROWSPEC has a column with datatype specified as %Date or %Time, Pyodbc fails to fetch it and throws this error.

"

pyodbc.Error: (' 2201', '[ 2201] [Cache ODBC][State : 22018 ][Native Code 22005]\r\nERROR #388: Unknown error, code 22005 (22005) (SQLGetData)')

"

on printing the cursor execute description, pyodbc reads the column as <int>.

0 3
0 823

Hello,

I'm trying to set Caché-Python Binding on Mac, but there is a problem.

I performed installation and configuration of Caché-Python binding module based on the manual (URL)
including setting of PATH and LD_LIBRARY_PATH in "bash_profile",
and they seems to be done successfully (there was no error in the process).

0 3
0 921

Hello there community,

I am pleased to say that i have started building a product and I have chosen InterSystems technology to be used in it.

But I have a confusion with regard to it.

I actually have to come to a conclusion to whether to use CACHE or IRIS.

I will be using a lot of data and also integrating it along with Python for DEEP and Machine Learning.

Also I do not have an idea of how to get the licensed version of either of that.

0 3
1 253
Question
· Nov 11, 2020
Create Database using Python
I am trying to create a database using python. The example shows setting a Name string and a Properties object containing Directory=.

; Use class methods to create an instance
 %SYS>s Name="ABC"
 %SYS>s Properties("Directory")="c:\abc\"
 %SYS>s Status=##Class(Config.Databases).Create(Name,.Properties)
 %SYS>i '$$$ISOK(Status) w !,"Error="_$SYSTEM.Status.GetErrorText(Status)

How do I update and pass the Directory property using Python?

0 3
0 232

I have an existing Python script that opens a child session using the pexpect library. But currently all it does is send hard-coded commands to the Cache process and expect a hard-coded response back in order to continue in the script.

I would like to run a Cache routine from the script, pass in a parameter, and wait for a response that will be different every time (a date, in this case). So the call would be something like D $$Tag^Routine(parameter) and wait for the routine to complete and return the response.

0 3
0 273

I was interested in accessing IRIS (Healthshare) using Python. I found instructions how to this here: https://github.com/intersystems/quickstarts-python/tree/master/Solutions...

The installation went well using pip and when python executes "import irisnative" it works fine. It just fails with a connection timeout when I try "irisnative.createConnection(...)." Below is my code:

0 3
0 224

Is there a way to automatically transform Object Script arrays to Python lists? This code results in a list of arrays

Iter0 =  dbnative.iterator("HS.Data.OIDMapD")
for subscript, value in Iter0.items():
    print(f"subscript={subscript}, value={value}")

Here is the result:

subscript=1, value=2.16.840.1.113883.3.86ISCInterSystems Corporation

I suppose it would be too hard to parse this into a list, I was just wondering if there was a function provided to make it convenient and proper.

Thanks,

Marlin Mixon

0 2
0 185

Hello everybody,

I've been experimenting with Embedded Python and have been following the steps outlined in this documentation: https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...

I'm trying to convert a python dictionary into an objectscript array but there is an issue with the 'arrayref' function, that is not working as in the linked example.

This is a snapshoot of my IRIS terminal:

0 2
1 29

I have the object query:

s Rset=##class(%ResultSet).%New("%SYSTEM.License.UserListAll")

I can loop through that query and it generates the report information that I need.

I have a Python process where I use the intersys import to connect to the Cache instance. But I have been unable to determine the correct syntax in Python for this query. Being that 'UserListAll' is a query I attempted to user:

res = <query>.prepare("select * from %SYSTEM.License_UserListAll")

0 2
0 292

I am writing a Python tools I want to access the %Monitor.System.License properties:

  1. AvailableDist
  2. AvailableLocal
  3. MaxUsedDist
  4. MaxUsedLocal
  5. CurrentUsedDist
  6. CurrentUsedLocal

Initially I want to develop Objectscript to verify access to the properties. But I can not figure the proper syntax.

I first attempted:

set ans = ##class(%Monitor.System.License).AvailableDist

which failed.

I tried another approach:

set ans = ##CLASS(%Monitor.System.License).%GetParameter("AvailableLocal")

0 2
0 252
Question
· Oct 27, 2020
Configure IRIS using Python

I am trying to configure IRIS using python. The first task I wanted to do it change the journal directory. I cannot figure out the right way to work with the Config.Journal class with python. I can get the text to query the current setting.

returnValue = dbnative.classMethodValue("Config.Journal","GetList")
print(returnValue )

But I don't see a straightforward way to parse the $List returned by GetList() I was hoping there was an easier way.

How do I

1. Query configuration parameters?

2. Set configuration parameters?

Using python?

0 2
0 205

When looking at the "Current License Usage Summary" web page, there is a line for both local and distributed "Maximum Connections". I have scrutinized every class that seems reasonable to contain this information but have found nothing that matches the values on the web page. I do not believe these are related to license specifically though I did review all of the potential attributes of the license related classes to no avail.

0 2
0 303

I'm after some more in-depth information about how the embedded python is implemented with regards to how it works when a python method is called from a CSP page. Will it run in the same Windows process? Will there be any issues with multitasking (considering python doesn't seem very good at this)?

Also, is there a performance penalty to pay for running embedded python vs "using IRIS APIs from Python".

Another question is what python interpreter the embedded python is using? Is it an Intersystems one or the regular c.python? Version?

Excited to go Python!

0 2
0 255

Using the below python script I am getting :

$ ./hello_world.py
Traceback (most recent call last):
File "/home/wwillett/dev/vscode-objectscript/Samples-python-helloworld/./hello_world.py", line 34, in <module>
run()
File "/home/wwillett/dev/vscode-objectscript/Samples-python-helloworld/./hello_world.py", line 21, in run
connection = irisnative.createConnection(ip, port, namespace, username, password)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: * [ERROR_SEQUENCE_ERROR]

1 2
0 87

Hi all,

Does anybody have the same issue?

$ZF(-100) to run python script not work when directly execute in studio or in storedproc called by TrakCare, but can work when do in iris session.

The python script imports a "barcode" package. It seems that when directly execute in studio or in storedproc called by TrakCare, the package can not be imported.

1 2
0 89