unreal.PythonScriptLibrary¶
- class unreal.PythonScriptLibrary(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
BlueprintFunctionLibraryPython Script Library
C++ Source:
Plugin: PythonScriptPlugin
Module: PythonScriptPlugin
File: PythonScriptLibrary.h
- classmethod execute_python_command_ex(python_command, execution_mode=PythonCommandExecutionMode.EXECUTE_FILE, file_execution_scope=PythonFileExecutionScope.PRIVATE) (command_result=str, log_output=Array[PythonLogOutputEntry]) or None¶
Execute the given Python command.
- Parameters:
python_command (str) – The command to run. This may be literal Python code, or a file (with optional arguments) that you want to run.
execution_mode (PythonCommandExecutionMode) – Controls the mode used to execute the command.
file_execution_scope (PythonFileExecutionScope) – Controls the scope used when executing Python files.
- Returns:
true if the command ran successfully, false if there were errors (the output log will show the errors).
command_result (str): The result of running the command. On success, for EvaluateStatement mode this will be the actual result of running the command, and will be None in all other cases. On failure, this will be the error information (typically a Python exception trace).
log_output (Array[PythonLogOutputEntry]): The log output captured while running the command.
- Return type:
tuple or None
- classmethod force_enable_python_at_runtime() bool¶
Force Python to be enabled and initialized, regardless of the settings that control its default enabled state.
- Returns:
True if Python was requested to be enabled. Use IsPythonInitialized to verify that it actually initialized.
- Return type:
- classmethod is_python_available() bool¶
Check to see whether Python support is available in the current environment. note: This may return false until IsPythonConfigured is true.
- Return type: