I am probably making a very basic mistake here as i am new to python, but I am having an issue where I run scripts by copy pasting the code driectly into the output log it works perfectly. But if I try to run the same script from a .py file on disk via the GUI or command line I get the following error:
Cmd: py ../../../../../../Users/christopher.zoog/Downloads/PythonExamples/PythonExamples/Unreal Studio Examples/ConvertActors/convert_actors.py
LogPython: Error: SyntaxError: invalid syntax (<string>, line 1)
The same code inside the convert_actors.py works fine if copy/pasted. Just curious as to what i am doing wrong.
Are you using 4.20? The UI failing to run a script in a path containing spaces is a known issue with 4.20 preview 1, and has been fixed for preview 2.
If you run the file from the output log you should be able to work around the issue by wrapping the filename/path in quotes to mitigate the spaces, eg) “my path/script.py”