linux - How can I open an external program using Python in Ubuntu? -
this question has answer here:
- calling external command in python 44 answers
there 2 questions ask, in advance.
(1) how can open external program in linux? know in windows there command os.startfile() open program, equivalent ubuntu open(), there's no response after run code, , alternative 1 subprocess.call(). works in windows, in ubuntu fails, provide standard templete can use for? (similarly double click icon of program)
(2) how can realize functions code able open terminal , write down several commands in terminal automatically using python?
os.system can work. example, want run 'ls' under shell. want_run='ls';os.system('bash -c '+ want_run);
Comments
Post a Comment