简体   繁体   中英

stopping a subprocess.call loop in my python code

def raspi_connecter():
    print("Below is the output from the shell script in terminal")
    subprocess.call('ssh dev@X.0.0.X', shell=True)

That code opens my raspi in my GUI program, however when i go to click the other buttons on my window (execute commands, update, import file) my mac has the rainbow wheel of death. I assume it is because it is caught in an open loop but maybe am wrong?

Would Popen be better than .call?

Using Popen should be the sulotion. Look in the documentation for more info https://docs.python.org/3/library/subprocess.html

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