if "open" in text:
app = text.split(" ", 1)
self.respond("opening " + app[1])
os.system("open -a " + app[1] + ".app")
收到此错误
open: invalid option -- 'a'
Usage: open [OPTIONS] -- command
This utility help you to start a program on a new virtual terminal
(VT).
Options:
-c, --console=NUM use the given VT number;
-e, --exec execute the command, without forking;
-f, --force force opening a VT without checking;
-l, --login make the command a login shell;
-u, --user figure out the owner of the current VT;
-s, --switch switch to the new VT;
-w, --wait wait for command to complete;
-v, --verbose print a message for each action;
-V, --version print program version and exit;
-h, --help output a brief help message.
答案1
答案2
当我直接调用它时它可以工作:
os.system("firefox")
但是,当您调用任何程序时,首字母不要大写也很重要,即:如果您调用时Firefox
出现错误但firefox
运行良好。