Hello World in Miranda

Our first program will print the classic “hello world” message. Here’s the full source code.

# hello_world.py
print("hello world")

To run the program, save the code into a file named hello_world.py and use the python command to execute it.

$ python hello_world.py
hello world

Python doesn’t require building programs into binaries like some other languages. However, if you want to package your Python script into a standalone executable, you can use a tool like PyInstaller.

First, install PyInstaller:

$ pip install pyinstaller

Then, create the standalone executable:

$ pyinstaller --onefile hello_world.py
$ ls dist/
hello_world

We can then execute the standalone executable directly.

$ ./dist/hello_world
hello world

Now that we can run and build basic Python programs, let’s learn more about the language.