unreal.EditorPythonScripting

class unreal.EditorPythonScripting(outer: Object | None = None, name: Name | str = 'None')

Bases: BlueprintFunctionLibrary

Utility class for Python scripting functionality.

C++ Source:

  • Plugin: EditorScriptingUtilities

  • Module: EditorScriptingUtilities

  • File: EditorPythonScriptingLibrary.h

classmethod get_keep_python_script_alive() bool

Returns the value of the bKeepPythonScriptAlive flag.

If this is false (default), it will close the editor during the next tick (when executing a Python script in the editor-environment using the UnrealEditor-Cmd commandline tool). If this is true, it will not close the editor by itself, and you will have to close it manually, either by setting this value to false again, or by calling a function like unreal.SystemLibrary.quit_editor().

Returns:

The current value of the bKeepPythonScriptAlive flag.

Return type:

bool

classmethod set_keep_python_script_alive(new_keep_alive) None

Sets the bKeepPythonScriptAlive flag.

If this is false (default), it will close the editor during the next tick (when executing a Python script in the editor-environment using the UnrealEditor-Cmd commandline tool). If this is true, it will not close the editor by itself, and you will have to close it manually, either by setting this value to false again, or by calling a function like unreal.SystemLibrary.quit_editor().

Parameters:

new_keep_alive (bool) – The new value of the bKeepPythonScriptAlive flag.