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.
Вы не нуждаетесь ни в какой дополнительной команде, просто называете программу непосредственно:
os.system(app[1])
Однако я использовал бы sh для этого.
Это работает, когда я называю его непосредственно:
os.system("firefox")
Однако также важно, чтобы первая буква не была капиталом при вызове любой программы, т.е.: если Вы звоните Firefox
Вы получаете ошибку, но firefox
работает хорошо.