Run script whith system.util.execute()

Hello, I wanted to ask how can I run an external python script with the command system.util.execute ()?
I have tried so many ways but, even if not giving an error, my python script does not run.

if its a python script, why not add it to the user libareries so you can call it with an import in your scripts?
or does it need to run in the gateway command line only?
the system.util.execute() runs code on the gateways commandline

I don’t put it in internal scripts so as not to import all dependencies.

um not sure if that even is a problem but oke, what is your script supposed to do than?
you know it runs in the command prompt right?

Are you sure it isn’t running? system.util.execute() doesn’t capture any output.

Also, if running from a gateway scope, it will run in the service’s account and that account may not have access to the script file.

Where is the file located, and what scope are you attempting to run system.util.execute() in?

In addition to what already has been said, you should also post the line of the script that is calling the system.util.execute just so we can rule out syntax issues.

Depending on what you’re trying to do, you could run your script separately through other triggers, then import the output into ignition.

I do that for a supervision project where some traffic data are displayed. A certain crontask on the server runs a script that logs its output (in json format), then in ignition I have an expression tag of Document data type, and runScript("system.file.readFileAsString", 5000, "/path/to/log/file") as its expression.
There might be better ways to do this but it works pretty well.