After installing Python 3.9 side-by-side with Python 3.6, one of our friends observed, “I noticed that the newer version, Python 3.9, became the default on my IBM i system. How does the default version get set?” I thought this was a good time to explain how IBM uses the update-alternatives program to set the default version of Python and other open source software packages.
Python on IBM i has proven itself as a tool for building utilities to create/read Excel files, transfer data, automate processes, call REST APIs such as Salesforce and ServiceNow, monitor applications, and more. What was missing was an easy way to use the power of Python from CL and RPG.
In 2019 we introduced you to the PYRUN command for running Python scripts from CL and RPG programs.
In this post we introduce you to QSHPYRUN, the next generation of PYRUN and part of Richard Schoen’s open source QShell on i Library – QshOni. QSHONI makes it easy for traditional CL and RPG programs to call Python utilities and use their output. This is supported via the QSHPYRUN command. QSHONI also supports general calls to other QShell, PASE and bash calls via the QSHEXEC and QSHBASH commands. This means QSHONI commands support calling Python, Node, PHP, Java and all things open source, making QSHONI much more versatile than the standalone PYRUN command was. The QSHONI commands can safely live side-by-side with the PYRUN command because they live in different IBM i libraries. This allows for migration to QSHPYRUN to happen as needed. Read more
Want to know which parts of your Python program take how much time? Which parts are slow, and how often they are called? Python includes tools to measure speed, but it’s not easy to visualize their meaning.
To make it easier, the QCachegrind tool graphically displays profiler output from a variety of languages. We first introduced our build of QCachegrind as a PHP tool, but you can put your Python programs under the QCachegrind microscope as well.
I recently caught up with Seiden Group CTO Stephanie Rabbani about the ODBC driver that’s quickly becoming standard for open source and web connections on Db2 for i.
Python has been gaining momentum for building utility applications on IBM i, such as creating/reading Excel files, data transfer, process automation, calling REST APIs such as Salesforce and ServiceNow, and application monitoring.
Although some have said that Python would become the “new CL,” one limitation remains. While Python can easily call CL, RPG, and COBOL programs, calls in the other direction—from CL, RPG or COBOL to Python—required extra effort.
With IBM’s delivery of open source capabilities on IBM i, Seiden Group has been there to apply the technology to application modernization initiatives. Starting with PHP and the PHP toolkit, then Python, and now Node.js and Ruby, we’ve worked with IBM and customers to flesh out the capabilities of the technology, teach best practices at conferences and directly with clients, and develop award-winning solutions.
So why complicate them with repetitive code that distracts from their power and simplicity?
As big fans of Python, Seiden Group now offers Python training for IBM i developers. Our training covers not only the popular Python language, but all the pieces necessary to succeed on IBM i, including how to use the Python toolkit to call RPG and COBOL business logic as well as best practices for accessing Db2 and SQL from web applications with Python.