linux - How can I open an external program using Python in Ubuntu? -


this question has answer here:

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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -