简体   繁体   中英

Executing external Python program in Sikuli script

I am trying to call a python program which just sends me a text on my phone from a Sikuli script.I am a beginner and my goal is to receive a text when a certain loop is finished, but I don't know how to call on it from the Sikuli script. This is a small part of my code from Sikuli so far.

while (something):
     if (randomThing):
       something = False


subprocess.Popen("python SendSMS.py")

I get an OS error saying no such file or directory. Is there a better way to do this? or what am I doing wrong here? I am using Mac.

subprocess.Popen() will look for SendSMS.py in same directory but if your script is not in that directory you will get find not found error which is totally expected. As a fix you will need to provide whole path to your script instead of just python SendSMS.py replace it with python /home/my_user/SendSMS.py and check if it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM