TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Execute python script on Mac or Windows

    Windows
    2
    2
    1.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      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?

      RussR 1 Reply Last reply Reply Quote 0
      • RussR
        Russ @Chaochao Yan
        last edited by Russ

        @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:

        python c:\users\russe\test.py
        

        Russell VanderMey

        1 Reply Last reply Reply Quote 0
        • First post
          Last post