如何通过python脚本以可执行文件执行命令

时间:2020-04-21 01:59:47

标签: python linux audio bluetooth raspberry-pi

目前,我可以将命令发送到外壳,但是一旦运行可执行的“蓝牙播放器”,我就无法再将命令发送到外壳Here is a image of what it outputs into the command line 这是我用来运行此简单脚本Here is the example code的代码示例 如果有人能更好地做到这一点,或者知道如何将命令发送到“蓝牙播放器”,请告诉我

我正在使用树莓派

1 个答案:

答案 0 :(得分:0)

您可以使用Subprocess()或Os.Popen(),这两个将帮助您获取变量中的Shell输出。您可以根据输出做出决定,以运行下一条命令。

检查一下: https://janakiev.com/blog/python-shell-commands/

相关问题