In Unreal Engine 4 (UE4), when using the Python API command line, the Editor usually does not update until the script execution is complete because the script is running in the same process as the Editor. This means that the Editor cannot update until the script has finished executing and control has been returned to the main thread.
The reason for this behavior is that the Python API command line runs scripts synchronously, meaning that the script blocks the main thread of the Editor, preventing it from updating while the script is running. As a result, any changes made to the Editor or the scene will not be visible until the script has finished executing and control has been returned to the main thread.
One way to address this issue is to break the script into smaller, more focused functions that can be executed sequentially, allowing the main thread to run in between each function call. This can improve the responsiveness of the Editor during script execution.
Another approach is to use asynchronous functions or multithreading within your script to perform tasks independently of the main thread. However, be cautious when using multithreading, as it can lead to race conditions or other issues if not implemented correctly.
In summary, the UE4 Editor does not update immediately when running scripts through the Python API command line because the script is running synchronously, blocking the main thread of the Editor. To improve the Editor's responsiveness during script execution, you can break the script into smaller functions and use asynchronous functions or multithreading where appropriate.