Encontrar

Artículo
· 24 jul, 2025 Lectura de 1 min

Executando Python no Terminal do InterSystems IRIS

Você está curioso para saber como executar scripts Python diretamente no terminal do InterSystems IRIS ou Caché? 🤔
Boa notícia: é fácil! 😆
O IRIS oferece suporte ao Embedded Python, permitindo que você use Python de forma interativa dentro do terminal do IRIS.

Como acessar o Shell do Python?

Para iniciar o shell do Python a partir do terminal do IRIS, basta executar o seguinte comando:

do ##class(%SYS.Python).Shell()

Esse comando abre um shell interativo do Python dentro do terminal do IRIS. A partir daí, você pode escrever e executar código Python como faria em um ambiente Python normal.

Como sair do Shell?

>>> quit()

Isso encerrará o shell do Python e retornará ao prompt do ObjectScript.

 

USER>do ##class(%SYS.Python).Shell()
 
Python 3.9.5 (default, May 31 2022, 12:35:47) [MSC v.1927 64 bit (AMD64)] on win32
Type quit() or Ctrl-D to exit this shell.
>>> name = 'Vachan'
>>> age = 25
>>> print('Name: ',name,'\nAge:',age)
Name:  Vachan
Age: 25
>>> quit()

 

Essa é uma ótima maneira de aproveitar os recursos do Python dentro do ambiente InterSystems.
Seja para experimentar, testar lógicas ou integrar com ObjectScript, o shell embutido do Python torna tudo mais rápido e flexível.

Bom código! 👨‍💻

Comentarios (0)1
Inicie sesión o regístrese para continuar
Artículo
· 24 jul, 2025 Lectura de 2 min

ChatGPT Plus Introducción a PEP 8

img

Este será un artículo breve sobre PEP 8, la guía de estilo de Python.

¿Qué es PEP 8?

En pocas palabras, PEP 8 proporciona directrices y buenas prácticas sobre cómo escribir código Python.

Comentarios (0)1
Inicie sesión o regístrese para continuar
Comentarios (0)1
Inicie sesión o regístrese para continuar
Pregunta
· 24 jul, 2025

Private Endpoint Parameter not used when using Google Cloud Storage API?

Hi,

I tried to create a client for Google Cloud Storage using a private endpoint.

like this:

S client=##class(%Net.Cloud.Storage.Client).%New()

S sc=client.CreateClient("",2,credentialsFile,"",.out,privateEndpoint)

But privateEndpoint seems not to be used when trying to send blob from a file:

D sc.UploadBlobFromFile(bucketname,blobname,filename)

We can see at the firewall that the client still tries to use the public endpoint for GCS.  

Even if the private endpoint is definitely reachable.

When we allow the public endpoint in the firewall then it is working as expected.

Is that a bug? Has anyone a clue what we could do?

Thanks a lot

Helmut

Comentarios (0)2
Inicie sesión o regístrese para continuar
Artículo
· 24 jul, 2025 Lectura de 1 min

Running Python in the InterSystems IRIS Terminal

Are you curious about how to run Python scripts directly in your InterSystems IRIS or Caché terminal? 🤔 Good news it's easy! 😆 IRIS supports Embedded Python, allowing you to use Python interactively within its terminal environment. 

How to access the Python Shell?

To launch the Python shell from the IRIS terminal, simply run the following command:

do ##class(%SYS.Python).Shell()

This opens an interactive Python shell inside the IRIS terminal. From here, you can write and run Python code just as you would in a normal Python environment.

Exiting the Shell:

>>> quit()

This will exit the Python shell and return you to the ObjectScript prompt.

 

USER>do ##class(%SYS.Python).Shell()
 
Python 3.9.5 (default, May 31 2022, 12:35:47) [MSC v.1927 64 bit (AMD64)] on win32
Type quit() or Ctrl-D to exit this shell.
>>> name = 'Vachan'
>>> age = 25
>>> print('Name: ',name,'\nAge:',age)
Name:  Vachan
Age: 25
>>> quit()

 

This is a great way to leverage Python's capabilities within your InterSystems environment. Whether you're experimenting, testing logic, or integrating with ObjectScript, the embedded Python shell makes it fast and flexible.

Enjoy Coding! 👨‍💻

4 comentarios
Comentarios (4)2
Inicie sesión o regístrese para continuar