Hi,<br><br>Well if I can remmeber since last time I did something similar in C, it was close stdin channel in the open devices table (I don't know if it is the correct name in english, I learnt it in spanish) and put a pipe on it and then create a fork, parent it comunicates to the child through the pipe, so if child run a shell program, through exec, you should be able to comunicate to his stdin through his parent... I think that was correct, if I remmember well...<br>
<br>My app is console app, working by basic commands like send cd or dir to the console. I thought redirecting stdin (keypad) I could send this basic comands to it... but obviously I was completely wrong...<br><br>I can not use dedicated virtual machines, and it has to be as similar as user environment as possible, and it can appear new windows that takes focus, so I have to assure i can get the focus every time before sending commands.... Quite tricky stuff.... if it is possible to do something like that in Python I can struggle a bit more, if not better leave right now before wasting time with nonsenses...<br>
Thanks,<br>Juan<br><br><div class="gmail_quote">2011/12/13 Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com">rosuav@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im">On Tue, Dec 13, 2011 at 11:35 PM, Juan Perez <<a href="mailto:corleone82@gmail.com">corleone82@gmail.com</a>> wrote:<br>
> My problem is thinking in windows console somewhat like linux shell, and do<br>
> same things I did with pipes in C programming. But it seems not to be the<br>
> case.<br>
<br>
</div>It is (at least, it supports the basics of pipes and redirection); but<br>
what you're looking at here is an application that appears not to use<br>
STDIN.<br>
<div class="im"><br>
> At a glance I dare say that sendkeys module is useful  enough, but if I've<br>
> understood well, you only can send messages to focused window, that will<br>
> report some inestabilities if windows focused is changed. You won't be able<br>
> to touch anything in the current laptop. So, is there any way to identify<br>
> the a process/window and send keystrokes in a smarter way and/or is it<br>
> possible to identify a window an get the focus on it?<br>
<br>
</div>You may be able to put focus to the window before sending it keys, but<br>
this is sounding extremely hackish (nearly as bad as the Magic: The<br>
Gathering Online trade-bot system). I'm thinking here the best option<br>
may be to give this a dedicated virtual machine and let it do whatever<br>
it likes - effectively, have an entire "computer" dedicated to just<br>
this application and its automation harness. That would probably make<br>
things simple enough that you don't need to worry too much about<br>
focus, sending keystrokes to other windows, etc.<br>
<br>
ChrisA<br>
<span class="HOEnZb"><font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br>