triangular-flag_1f6a9.png

Here you will learn how to run Python inside of Unreal!

You don’t need to worry about the Python syntax or the meaning of what you will type, just copy paste stuff, we’ll learn about Python programming in the next chapter ;)

Table of contents

Running Python from the console

Open the Output Log window, choose Python in the bottom left dropdown, type the following and press Enter.

print("Hello world") 

01.gif

⛳ After that, you will see your very first python console command result in the Output Log.

From there, you can execute any Python code, even on multiple lines. Here are some examples:

<aside> ❕ If you don’t understand the meaning of these, it’s ok, we’ll learn about that later on 🙂

</aside>

<aside> ❔ Press SHIFT+ENTER to enter a new line.

To add a tabulation, simply press TAB. Otherwise, a tabulation is 4 spaces in Python.

</aside>

<aside> <img src="/icons/computer-chip_gray.svg" alt="/icons/computer-chip_gray.svg" width="40px" /> When you press ENTER, UE will run the Python Interpreter (python.exe ) stored in UE files. Running Python in UE only works on Windows, in Editor.

</aside>

Ok so we can run some Python from the Output Log window, cool! But it is really useful? Well, yes and no. You can try few things in there, but most of the time you will write Python in files (called scripts) as it’s much more convenient!

Things that will make your life easier