|Attention||Topic was automatically imported from the old Question2Answer platform.|
I am trying to execute a .py file from a .gd script with the following code:
var global_dir_path = ProjectSettings.globalize_path("res://OAuth2.0") var ERR = OS.execute("python", [global_dir_path + "/get_credentials.py"], true) if ERR == OK: get_token_from_JSON() else: push_error("ERROR EXECUTING 'get_credentials.py' WITH ERROR CODE: %s"%ERR)
I am getting an ERR == 1, which is “FAILED = 1 — Generic error” from the Godot Docs.
I know for a fact that the script works when run from my IDE and the command line, and that the path to the .py script is correct. I am wondering if there are some permissions I am violating or something?
The .py script accesses scripts in its local directory. do you think that is the issue somehow?
Are you able to execute the exact same command in cmd/terminal?
timothybrentwood | 2021-08-11 22:00
Yes this works in the terminal. I think it might have something to do with the fact that I have
python as an alias for
python3.9 in my terminal.
scrubswithnosleeves | 2021-08-11 22:22