[Tutor] pipeline - what is it and how do I use it?
Evert Rol
evert.rol at gmail.com
Sun Nov 25 19:38:11 CET 2007
> I need to keep a bit of python code ready to run at anytime, in the
> ram, but this is what I need to do
>
> I am using two languages at the same time, because python doesn't
> really have any effective way of simulating keyboard and mouse events,
Well, not the language itself, but there may be some library out
there that has this functionality. But I guess it'll indeed be hard
to find though.
> so I need to run auto it 3, and then call my python code to perform
> a little bit of work, it only takes 0.1 seconds to run, but it
> takes almost a second to start the code,
> if i I can keep the code alive in the ram waiting for the cue, then
> it should run fast enough.
>
> but how do I pass information from one code to the other?
>
> in fact - another language.
It's the virtual machine you want to keep around in memory (together
with the code), not so much the code itself.
The quickest thing I can think of right now is having a daemon
program running, and communicate with it through signals or sockets.
But that doesn't feel very (thread)safe.
Depending on your problem, you may want to go at it in another way.
In fact, if speed is a concern, you may be better off writing your
time essential code in C or something, and compile it to machine
code. Less fun & easy than to code in Python probably.
btw: odd subject line, when relating it to the actual question ;-)
More information about the Tutor
mailing list