Execute python script on Mac or Windows
Chaochao Yan last edited by
I am trying to run a python script like setting a trigger as "Command: python /Users/Documents/test.py". But it seems like it does not work. Can I execute a python script with triggercmd?
@chaochao-yan, I tested it, and it worked for me on my Windows 10 PC.
I had to close and re-open the TRIGGERcmd agent before I could run python commands because when you install python it adds itself to your PATH environment variable, but environment variables don't get updated for each process until you restart them.
Anyway, here's my test python script in case you're interested:
f= open("c:\\users\\russe\\test.txt","w+") for i in range(10): f.write("This is line %d\r\n" % (i+1)) f.close()
Here's my command that TRIGGERcmd ran: