[Tutor] How to interact with the result of subprocess.call()

Alan Gauld alan.gauld at yahoo.co.uk
Sun Dec 25 14:26:13 EST 2016

On 25/12/16 17:08, boB Stepp wrote:

> Then I see that I have a GCE (Gross Conceptual Error) floating around.
> I thought that event loops are just intercepting the redirected stdin
> from the keyboard.  This is not true?  If not, then how is this
> working?

No event loops don't use stdin. They are monitoring the
hardware devices directly and creating event objects that
are put in a queue maintained by the GUI framework itself.
Most frameworks allow you create your own events and
inject them into the queue but they don;t come from stdin.
You could write a background thread that read stdin and
generated events from there but that's not normal by any
means. Some GUI programs will read stdin and process anything
found there but its usually a completely different set
of commands from those used by the normal user - and
even this is very rare.

For more exact detail of how GUIs get their input you
will need to investigate the individual GUIs, even
drilling down to X-Server level or the Windows API.

Alan G
Author of the Learn to Program web site
Follow my photo-blog on Flickr at:

More information about the Tutor mailing list