Get an error when i try to open application from Python
up vote
1
down vote
favorite
if "open" in text:
app = text.split(" ", 1)
self.respond("opening " + app[1])
os.system("open -a " + app[1] + ".app")
get this error
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.
python python-2.7
New contributor
Ahmed Aftab is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
|
show 1 more comment
up vote
1
down vote
favorite
if "open" in text:
app = text.split(" ", 1)
self.respond("opening " + app[1])
os.system("open -a " + app[1] + ".app")
get this error
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.
python python-2.7
New contributor
Ahmed Aftab is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
Theopencommand doesn't have an option-aso you can't use it. What do you expect it to do?
– Florian Diesch
Nov 25 at 13:18
i just want to open a program which one i speak for example if i said open firefox then firefox opened
– Ahmed Aftab
Nov 25 at 13:31
What’s the difference to calling it directly with e.g.os.system("firefox")?
– dessert
Nov 25 at 13:44
wow its working
– Ahmed Aftab
Nov 25 at 13:52
thanks @dessert for helping
– Ahmed Aftab
Nov 25 at 13:58
|
show 1 more comment
up vote
1
down vote
favorite
up vote
1
down vote
favorite
if "open" in text:
app = text.split(" ", 1)
self.respond("opening " + app[1])
os.system("open -a " + app[1] + ".app")
get this error
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.
python python-2.7
New contributor
Ahmed Aftab is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
if "open" in text:
app = text.split(" ", 1)
self.respond("opening " + app[1])
os.system("open -a " + app[1] + ".app")
get this error
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.
python python-2.7
python python-2.7
New contributor
Ahmed Aftab is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Ahmed Aftab is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Ahmed Aftab is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked Nov 25 at 13:02
Ahmed Aftab
61
61
New contributor
Ahmed Aftab is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Ahmed Aftab is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Ahmed Aftab is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
Theopencommand doesn't have an option-aso you can't use it. What do you expect it to do?
– Florian Diesch
Nov 25 at 13:18
i just want to open a program which one i speak for example if i said open firefox then firefox opened
– Ahmed Aftab
Nov 25 at 13:31
What’s the difference to calling it directly with e.g.os.system("firefox")?
– dessert
Nov 25 at 13:44
wow its working
– Ahmed Aftab
Nov 25 at 13:52
thanks @dessert for helping
– Ahmed Aftab
Nov 25 at 13:58
|
show 1 more comment
1
Theopencommand doesn't have an option-aso you can't use it. What do you expect it to do?
– Florian Diesch
Nov 25 at 13:18
i just want to open a program which one i speak for example if i said open firefox then firefox opened
– Ahmed Aftab
Nov 25 at 13:31
What’s the difference to calling it directly with e.g.os.system("firefox")?
– dessert
Nov 25 at 13:44
wow its working
– Ahmed Aftab
Nov 25 at 13:52
thanks @dessert for helping
– Ahmed Aftab
Nov 25 at 13:58
1
1
The
open command doesn't have an option -a so you can't use it. What do you expect it to do?– Florian Diesch
Nov 25 at 13:18
The
open command doesn't have an option -a so you can't use it. What do you expect it to do?– Florian Diesch
Nov 25 at 13:18
i just want to open a program which one i speak for example if i said open firefox then firefox opened
– Ahmed Aftab
Nov 25 at 13:31
i just want to open a program which one i speak for example if i said open firefox then firefox opened
– Ahmed Aftab
Nov 25 at 13:31
What’s the difference to calling it directly with e.g.
os.system("firefox")?– dessert
Nov 25 at 13:44
What’s the difference to calling it directly with e.g.
os.system("firefox")?– dessert
Nov 25 at 13:44
wow its working
– Ahmed Aftab
Nov 25 at 13:52
wow its working
– Ahmed Aftab
Nov 25 at 13:52
thanks @dessert for helping
– Ahmed Aftab
Nov 25 at 13:58
thanks @dessert for helping
– Ahmed Aftab
Nov 25 at 13:58
|
show 1 more comment
1 Answer
1
active
oldest
votes
up vote
0
down vote
You don’t need any additional command, just call the program directly:
os.system(app[1])
However, I’d rather use sh for that.
See comment on question.
– Jacob Vlijm
Nov 25 at 14:26
@JacobVlijm What do you recommend, sh?
– dessert
Nov 25 at 14:36
1
subprocess, either .call or .Popen, depending on the situation.
– Jacob Vlijm
Nov 25 at 14:40
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You don’t need any additional command, just call the program directly:
os.system(app[1])
However, I’d rather use sh for that.
See comment on question.
– Jacob Vlijm
Nov 25 at 14:26
@JacobVlijm What do you recommend, sh?
– dessert
Nov 25 at 14:36
1
subprocess, either .call or .Popen, depending on the situation.
– Jacob Vlijm
Nov 25 at 14:40
add a comment |
up vote
0
down vote
You don’t need any additional command, just call the program directly:
os.system(app[1])
However, I’d rather use sh for that.
See comment on question.
– Jacob Vlijm
Nov 25 at 14:26
@JacobVlijm What do you recommend, sh?
– dessert
Nov 25 at 14:36
1
subprocess, either .call or .Popen, depending on the situation.
– Jacob Vlijm
Nov 25 at 14:40
add a comment |
up vote
0
down vote
up vote
0
down vote
You don’t need any additional command, just call the program directly:
os.system(app[1])
However, I’d rather use sh for that.
You don’t need any additional command, just call the program directly:
os.system(app[1])
However, I’d rather use sh for that.
edited Nov 25 at 14:41
answered Nov 25 at 14:08
dessert
21.3k55896
21.3k55896
See comment on question.
– Jacob Vlijm
Nov 25 at 14:26
@JacobVlijm What do you recommend, sh?
– dessert
Nov 25 at 14:36
1
subprocess, either .call or .Popen, depending on the situation.
– Jacob Vlijm
Nov 25 at 14:40
add a comment |
See comment on question.
– Jacob Vlijm
Nov 25 at 14:26
@JacobVlijm What do you recommend, sh?
– dessert
Nov 25 at 14:36
1
subprocess, either .call or .Popen, depending on the situation.
– Jacob Vlijm
Nov 25 at 14:40
See comment on question.
– Jacob Vlijm
Nov 25 at 14:26
See comment on question.
– Jacob Vlijm
Nov 25 at 14:26
@JacobVlijm What do you recommend, sh?
– dessert
Nov 25 at 14:36
@JacobVlijm What do you recommend, sh?
– dessert
Nov 25 at 14:36
1
1
subprocess, either .call or .Popen, depending on the situation.
– Jacob Vlijm
Nov 25 at 14:40
subprocess, either .call or .Popen, depending on the situation.
– Jacob Vlijm
Nov 25 at 14:40
add a comment |
Ahmed Aftab is a new contributor. Be nice, and check out our Code of Conduct.
Ahmed Aftab is a new contributor. Be nice, and check out our Code of Conduct.
Ahmed Aftab is a new contributor. Be nice, and check out our Code of Conduct.
Ahmed Aftab is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1095901%2fget-an-error-when-i-try-to-open-application-from-python%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
The
opencommand doesn't have an option-aso you can't use it. What do you expect it to do?– Florian Diesch
Nov 25 at 13:18
i just want to open a program which one i speak for example if i said open firefox then firefox opened
– Ahmed Aftab
Nov 25 at 13:31
What’s the difference to calling it directly with e.g.
os.system("firefox")?– dessert
Nov 25 at 13:44
wow its working
– Ahmed Aftab
Nov 25 at 13:52
thanks @dessert for helping
– Ahmed Aftab
Nov 25 at 13:58