dos promt simulation

I.C. theivo at abv.bg
Sat Apr 13 17:39:58 EDT 2002


> there is also popen2, popen3 etc. they give you a file for stdin where you 
> can write to.

Maybe popen2\3 could help, but I think, I don't use them correctly :

import os
dos_input, dos_output = os.popen2('time')

for line in dos_output.readlines(): # Current time is 22:14:43,24
        print line                  # Enter new time:

dos_input.write(raw_input())        # User enters the new time

Where is my mistake?

I.C.



More information about the Python-list mailing list