Nuke ships with a comprehensive Python application programming interface (API), enabling you to perform user interface actions using Python scripting. This chapter describes how you can use the Script Editor for executing Python scripts and directs you to sources of more information on Python.
Here's a quick overview of the workflow:
1. | Enter Python statements in Nuke’s Script Editor to perform the actions you want to perform. |
2. | Save your script with the extension .py in a directory that is contained in the sys.path variable. |
3. | Later, when you want to execute the same statement sequence, import the .py file into Nuke’s Script Editor. Nuke executes the statements in the specified order. |
If you need more information on using Python in Nuke, you can always turn to the Nuke Python Developer’s Guide (Help > Documentation).
TIP: You can import Nuke as a module into a third-party Python 2.7.3 interpreter. See Nuke as a Python Module for more information.
TIP: You can also run an interactive Python session on the command line with nuke -t.