Exec script to UI app

You are running a script using the GTK toolkit that requires access to a desktop GUI. In fact, you are using the LXDE's desktop terminal app to run a PYTHON programme and you don't need to do that.

Your script should simply be python3 my_script.py. And for that, you can simply add that command to a Node-RED exec node. The output of the script will be returned as a msg to Node-RED and you can output it or process it as needed.