Create a “Hello World” Python Application on IBM i

  • Home
  • /
  • Blog
  • /
  • Create a “Hello World” Python Application on IBM i

March 22, 2024

Let’s create a simple “Hello, World!” Python application on IBM i.

Setting Up Your Environment

Ensure you have Python installed on your IBM i system. If not, you can install it easily using the IBM i ACS Opensource installer

Open a terminal or SSH session to your IBM i system

Create a Directory in the IFS

Navigate to a suitable location and create a new directory for your project. For example:

mkdir /home/HelloWorldApp
cd /home/HelloWorldApp

Create a Python File

Inside the HelloWorldApp directory, create a new Python file (e.g., yourAppName.py):

touch hello_world_app.py

Edit the Python File

Open hello_world_app.py in a text editor. You can use EDTF in IBM i command line, or any IFS File code editor — my recommendation is to use Visual Studio Code

Add the following simple line of code to your app.py file:

print('Hello World')

Run Your Application from PASE

Execute your Python script to set your environment and call your new python script:

PATH=/QOpenSys/pkgs/bin:$PATH
export PATH
python3 hello_world_app.py

Congratulations! You’ve created a basic “Hello World” Python application on IBM i.

You should see the output: “Hello World”

The next adventure is to build upon this foundation for more complex projects! Happy coding!

For more details, refer to the official IBM documentation.

NickLitten


IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Shameless Trekkie, Belligerent Nerd, Englishman Abroad and Passionate Eater of Cheese and Biscuits.

Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day.

Enjoy your stay, feel free to comment and remember: If at first you don't succeed then skydiving probably isn't a hobby you should look into.

Nick Litten

related posts:

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Subscribe NOW
7-day free trial

Take This Course with ALL ACCESS

Unlock your Learning Potential with instant access to every course and all new courses as they are released.
 [ For Serious Software Developers only ]

Online Learning for IBM i Software Technology Professionals

“The more that you read, the more things you will know. The more that you learn, the more places you’ll go.” – Dr. Seuss

>