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

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

Ansible warning on jinja2 braces on when -