title: How to write a command line program which can be accessed by a separate frontend?
body: <p>I've been writing command line applications (mainly in Python) for quite a while now, and I've also been doing a bit of GUI programming using (Py)Qt. In the GUI program's I've written, the programs logic and the GUI were often quite integrated. I am now wondering however, how I could write a GUI front end, for the pure command line programs which I've written. Or in other words; how do I write a command line program so that a GUI could be developed completely separate from it?</p>
  
  <p>Although I am most interested in Python implementations I think the answer could be pretty general.</p>