---
title: "Working with Python Scripts in PiXYZ Studio"
content_type: tutorial
url: "https://learn.unity.com/tutorial/working-with-python-scripts-in-pixyz-studio?language=en"
language: en
difficulty: intermediate
duration_minutes: 30
unity_version:
  - "2019.4"
supported_unity_versions:
  - name: "2019.4"
    url: "https://learn.unity.com/tutorial/working-with-python-scripts-in-pixyz-studio.md?language=en&version=2019.4"
available_languages:
  - name: "en"
    url: "https://learn.unity.com/tutorial/working-with-python-scripts-in-pixyz-studio.md?language=en"
  - name: "ja"
    url: "https://learn.unity.com/tutorial/working-with-python-scripts-in-pixyz-studio-jp.md?language=ja"
last_updated: "2026-08-04T14:23:48.000Z"
---

# Working with Python Scripts in PiXYZ Studio

Learn to write Python scripts in Pixyz Studio to automate time-consuming or repetitive tasks.

Python is at the core of PiXYZ Studio, and scripts are an effective way to leverage its power to perform time-consuming or repetitive tasks. In this tutorial you will learn how to script within PiXYZ Studio.

## 1. Working with Python Scripts in PiXYZ Studio

_This tutorial has been verified using Unity 2019 LTS and PiXYZ 2020.1.1.8._

Python is at the core of PiXYZ Studio and scripts are an effective way to leverage its power to perform time-consuming or repetitive tasks. As you perform functions in PiXYZ Studio via the regular menus, in the Output pane you’ll see references made to their Python commands.
**(Figure 01)**

![Figure 01: Many menu functions, such as Move nodes, are just front-end shortcuts for Python commands.](https://connect-mediagw.unity.com/h1/20201128/learn/images/ce4007b7-5d50-4a90-941c-1fa84af4513d_image6.jpg)

To learn more about PiXYZ Studio’s Python bindings, see [the API documentation](https://www.pixyz-software.com/documentations/html/2020.1/studio/ScriptingWiththePythonAPI.html). PiXYZ Studio also ships with a number of Python scripts. To access them, select Open Sample Scripts Directory from the Help dropdown. **(Figure 02)**

![Figure 02: The sample scripts are a great introduction to Python scripting in PiXYZ Studio.](https://connect-mediagw.unity.com/h1/20201128/learn/images/0952bcbd-d203-4f50-acee-cb3216f98b36_image3.jpg)

Python scripts can be loaded by dragging and dropping them directly from Explorer into the Script pane. To toggle the visibility of the Script panel, select Script from the Windows dropdown. **(Figure 03)**

![Figure 03: Enabling the Script pane](https://connect-mediagw.unity.com/h1/20201128/learn/images/832d5565-ec2f-45ec-a279-834bd0e1bae9_image5.jpg)

The Script panel consists of a row of buttons **(Figure 04)** above an area for scripts.

![](https://connect-mediagw.unity.com/h1/20201128/learn/images/fca93cb0-7459-418a-a6e8-2ff17788c040_image7.jpg)

![Figure 04: Script panel’s buttons, explained below](https://connect-mediagw.unity.com/h1/20201128/learn/images/832c7663-7709-4657-85dc-bb5a7c4ad757_image4.jpg)

The buttons, from left to right:

1. **New File** - Create a new file in a separate tab.
2. **Open A Script** - Opens a window to load a saved Python script.
3. **Save Script** - Saves the current script.
4. **Save Script to a File** - Saves the current script to a new file.
5. **Execute the Script** - Runs the entire script.
6. **Execute Selection** - Runs only the selected lines.
7. **Interrupt Pixyz Process** - Button activates if the current script contains the core.interruptionRequested() command, used to stop the execution of the script.
8. **Show Non-Printable Characters** - Toggles the non-printable characters on and off.
9. **Open Sample Scripts Directory** - Opens a window to the installation directory of the _Sample Script Directory_

## 2. Loading Scripts

You can either drag and drop a script from Windows Explorer into the Script panel, or click the Load Script button. **(Figure 05)**

![Figure 05: Script Panel](https://connect-mediagw.unity.com/h1/20201128/learn/images/ada64514-de70-4659-a32a-2c50ed3ebaff_image1.jpg)

## 3. Creating Scripts

You can create a script by clicking the New Script button **(Figure 06)**

![Figure 06: New script button](https://connect-mediagw.unity.com/h1/20201128/learn/images/7d5d6128-7762-4852-98ba-362108e0be32_image2.jpg)

## 4. Conclusion

Python in PiXYZ Studio is a powerful tool to add to your arsenal. Be sure to check out the sample scripts and [the API documentation](https://www.pixyz-software.com/documentations/html/2018.3/studio/api/index.html).
