in reply to How to control input of a child programme ...
Warning: For most programming tasks there are alternate modules which are cleaner solutions. For example to list files you may want to use one of these.