Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create an Ubuntu Application which has a GUI for a CLI-application. I want to run a terminal command, for example, on a button click in my application. How can I do this? Or should I really not being doing this?

Can I also grab what would be displayed as the last/current line when running the terminal command?

(I am writing my app using Quickly as described here)

share|improve this question
up vote 1 down vote accepted

Python (the programming language the desktop Quickly template uses) provides the subprocessing module for calling other programs. The documentation is here:

It provides convenience functions, but for the more advanced stuff (like reading the output as you described if I recall correctly) you often need to use its Popen class.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.