On Wed, Mar 10, 2010 at 4:51 PM, Armstrong, Richard J. <
rarms...@water.ca.gov> wrote:

>
>
> The dos program pops up and if I hit the enter key three times then it
> runs. How can I add these three “enters” into the script?
>

I'm not at all sure if this way would work, but you could send the \r\n
through a pipe:

p = subprocess.Popen([file1, file2, file3], stdin=subprocess.PIPE)
p.communicate("\r\n\r\n\r\n") # Three windows line ending sequences.

it also may be possible to add them to the end of the last parameter:
'b.txt\r\n\r\n\r\n'

I don't have much faith that it will work, but you can certainly try!

HTH,
Wayne
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to