検索

質問
· 2025年8月6日

Redirecting Python output to the device ObjectScript method is called from for output capture?

I have a custom Buffer class which is designed to capture written/printed statements to the device, to be able to transform the captured text to string or stream type. I have used this in ObjectScript to capture ObjectScript write statements and return a string. I would like to try to use this with a [ Language = python ] method as follows. This class will be called by a scheduled task.

/// ObjectScript code which initializes buffer to capture statements written in nested method call
ClassMethod CollectStringFromBuffer() 
{
    set buffer = ##class(CustomClass.Buffer).%New()
    do buffer.BeginCaptureOutput()
    do ..PythonMethodWithPrintStatments() // Capture all statements written by this call
    do buffer.EndCaptureOutput()
    do buffer.ReadToString(.errorOutput)
}

/// Python code which executes Python print and IRIS write statement
ClassMethod PythonMethodWithPrintStatments() [ Language = python, Private ]
{
    import iris 
    print("Python print this line to the buffer")
    iris.execute('write "IRIS write this line to the buffer"')
}

The Python method is not printing to the same device as the ObjectScript method is called from, so the buffer is not actually capturing these statements.

I am thinking through some alternative solutions, but I am curious first if anyone has advice on ways to redirect Python output that would be usable with the current solution? Thanks!

4 Comments
ディスカッション (4)3
続けるにはログインするか新規登録を行ってください
ディスカッション (15)1
続けるにはログインするか新規登録を行ってください
お知らせ
· 2025年8月6日

Communauté francophone représentée au concours d'outils de développement InterSystems

Bonjour à tous,

Nous avons le plaisir d’annoncer qu’un membre apprécié de notre communauté, @Antoine.Dh, a participé au concours d'outils de développement InterSystems avec son application PyObjectscript Gen !

À propos de PyObjectscript Gen

  • Qu’est-ce que c’est ?

Il s’agit d’une bibliothèque Python permettant la génération de classes ObjectScript de manière simple et extensible.

  • Points forts :
  • Génération de classes ObjectScript à partir de Python
  • Interface claire et épurée pour les développeurs Python
  • Architecture extensible, pour adapter ou enrichir le comportement selon vos besoins
  • Installation :
pip install pyobjectscript_gen

Ou depuis le dépôt GitHub d’Antoine.


Un grand bravo à Antoine ! 👏 Son outil allie simplicité et puissance, et offre une vraie valeur pour les développeurs IRIS qui veulent générer du code ObjectScript en utilisant Python.

Ce serait fantastique que davantage de membres de notre communauté participent à ce type de concours à l’avenir. En attendant, ne manquez pas le concours de rédaction d'articles techniques qui se tiendra en septembre — une excellente opportunité pour partager votre expertise et vos projets !

Je vous souhaite à tous un excellent été et… bonne chance !

ディスカッション (0)1
続けるにはログインするか新規登録を行ってください
InterSystems公式
· 2025年8月6日

Anuncio de lanzamiento de InterSystems Reports versión 25.1

La versión 25.1 de InterSystems Reports ya está disponible en el sitio de Distribución de Software de InterSystems, en la sección de Componentes. El software está etiquetado como InterSystems Reports Designer e InterSystems Reports Server y está disponible para los sistemas operativos Mac OSX, Windows y Linux.

Este nuevo lanzamiento incluye mejoras y correcciones de nuestro socio, insightsoftware. InterSystems Reports 25.1 está basado en Logi Report versión 25.1, que incluye:

- soporte para la construcción dinámica de asuntos en la distribución programada de informes por correo electrónico

- capacidad para cambiar fácilmente entre unidades de medida métricas e imperiales

- varias mejoras para facilitar la alineación en el diseño de informes de página con precisión de píxeles

Para más información sobre estas y otras funciones, consultad las notas de la versión disponibles de insightsoftware.

Tened en cuenta que la instalación de InterSystems Reports 25.1 requiere JDK versión 11 o 17 para poder ejecutarse. Por favor, actualizad si estáis utilizando JDK 8 antes de la instalación de InterSystems Reports.

Para más información sobre InterSystems Reports, consultad la documentación de InterSystems y el contenido de los servicios de aprendizaje.

ディスカッション (0)1
続けるにはログインするか新規登録を行ってください
記事
· 2025年8月6日 1m read

ADVERTENCIA: Error en la API Nativa de IRIS

Revisando mis paquetes publicados, identifiqué un error grave en la API Nativa de IRIS.

  • Hay un método en %Net.DB.Iris llamado function().
  • Es equivalente a $$etiqueta^rutina(param) en ObjectScript.
  • Solía funcionar bien hace 2 años, cuando publiqué mis paquetes de extensiones de línea de comandos.
  • Ahora está roto desde hace al menos un año y lanza <PROTECT>.
  • Lo identifiqué en ObjectScript, Java, Python y Node.js.
  • Está reportado como WRC# 1002589.
  • Para los 4 casos, también verifiqué una solución temporal:
    • En lugar de llamar una función de ObjectScript, se llama a un método de clase.
    • Esto se hace mediante %Net.DB.Iris.ClassMethodValue(...).
    • Y hay que envolver la función de ObjectScript dentro de alguna clase.
    • Puede parecer simple, pero requiere bastante esfuerzo en relación con versiones de IPM y otros aspectos.

Ojalá no os hayáis visto afectados por esta sorpresa.

ディスカッション (0)1
続けるにはログインするか新規登録を行ってください