dos promt simulation

Bengt Richter bokr at oz.net
Sat Apr 13 22:51:16 EDT 2002


On 13 Apr 2002 14:39:58 -0700, theivo at abv.bg (I.C.) wrote:

>> 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 would guess that's probably one.

Regards,
Bengt Richter



More information about the Python-list mailing list