Run python code async?

Hi, I want to ask I write a python code to save images and sent o api. I use async await in my code. I add a shell script and write the path where my python file is. but the KM is not running this. When I write the same path in terminal then it runs and works but not in KM.

You will need to specify the full path to any executables (like the python interpreter)

(it's not enough to provide the full path to your data files)

I already specify the full path but not running in KM but in terminal

Can you post your macro? I suspect there's an issue with path quoting, but without seeing what you're trying to do, it's tough to say.


To the data or to the python3 executable ?

These are not the same shell environments.

(The Keyboard Maestro Execute Shell Script action provides a blank sheet of paper. It does not import $PATH, or any other environment variables, from the application)

As @griffman points out, to get help you would need to show your macro.


I am doing this in shell script
/Users/mojoservo/Automation_KM_MUAZ/.venv/bin/python3 /Users/mojoservo/Automation_KM_MUAZ/

This was working when I write another python script. It is giving me response in display text but now I am doing discord code which use async await under the hood and no response is displaying in KM.

Without seeing your macro, and without knowing anything about the Discord add-ons to Python, it's possible that it and KM just aren't compatible: If it's running stuff async, your macro may run and finish running before a reply is received? That's a total guess, though, as we don't know what your macro looks like, and (at least for me) I have never used nor even seen Discord Python code.


(Also conceivable that some aspect of your Python virtual environment depends on shell variables which would need to be exported to – or defined in – the KM shell, but without seeing your macro, it's not easy for anyone to help)