如何通过 python 脚本在可执行文件中执行命令
How to execute commands in exucutable via python script
目前我可以向 shell 发送命令但是一旦我 运行 "bluetooth-player" 可执行文件我就不能再向 shell 发送命令 Here is a image of what it outputs into the command line
在这里,我有一个代码示例,我正在使用 运行 这个简单的脚本 Here is the example code
如果有人有更好的方法或知道如何向 "bluetooth-player" 发送命令,请告诉我
我正在使用 raspberry pi
您可以使用 Subprocess() 或 Os.Popen(),这两个将帮助您获得变量中的 shell 输出。您可以根据 运行 下一个命令的输出做出决定。
目前我可以向 shell 发送命令但是一旦我 运行 "bluetooth-player" 可执行文件我就不能再向 shell 发送命令 Here is a image of what it outputs into the command line 在这里,我有一个代码示例,我正在使用 运行 这个简单的脚本 Here is the example code 如果有人有更好的方法或知道如何向 "bluetooth-player" 发送命令,请告诉我
我正在使用 raspberry pi
您可以使用 Subprocess() 或 Os.Popen(),这两个将帮助您获得变量中的 shell 输出。您可以根据 运行 下一个命令的输出做出决定。