[Python-au] Re: python-au Digest, Vol 18, Issue 8

Jon john.windle at silverbrookresearch.com
Thu Dec 30 01:37:59 CET 2004


I've solved my own problem, well the python one anyway.

In the master I need to use win32pipe.CreateNamedPipe to create a pipe
yielding a PyHandle
Then I invoke the slave process
        the slave process connects to the pipe using win32file.CreateFile

In the master I use win32pipe.ConnectNamedPipe to tell me when the slave has
connected
I can then read and write to the pipe as I'd expect and the
win32pipe.PeekNamedPipe function works as I expect.

A good reference book on the win32 API would have made it easier than
bouncing between the ActiveState referenece and the MSDN library; any
suggestions?

Thanks.

john

> Subject: [Python-au] Processes and pipes; newbie alert
>
> I have a program launchs a seperate processes and I can send commands to
it
> and get response back. But it is blocking and I'd like to be able to see
if
> there is a response ready before I try and read the pipe.
>
> I think that win32pipe.PeekNamedPipe would do it but when I use it I get a
> type error that says "TypeError: The object is not a PyHANDLE object". The
> documentation seems sparse so after spending a bit of time playing. and
> searched the archives with no joy so I thought I'd ask.
>





More information about the python-au mailing list