FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log inLog in 


pipes vp and python

Post new topic   Reply to topic    discuss.visual-prolog.com Forum Index -> Visual Prolog
View previous topic :: View next topic  
Author Message
drspro2



The Netherlands
Joined: 28 Apr 2006
Posts: 171

PostPosted: 31 Aug 2017 11:42    Post subject: pipes vp and python Reply with quote

I am trying to call the pipe-server in Vp , so that vp writes to a pipe,

then in Python i try to read from this pipe server, it doesnt connect,

can it be the unequal with the pipe name?, the pipe is not written anywhere as i file, to be able to check the name ?.

I created a chromium web browser in python, and now i would like Vp and python communicate through the pipe system, so that it can open a new Url ( when vp writes to the pipe) without opening a new window.

Vp code : ( to write to the pipe )

    PipeName = pipeStream::makeLocalPipeName("pipe_vp_read"),
    Pipe = pipeStream::openServer(PipeName),
    Pipe:writef("\n % % %","ooo","eeee","\n"),
    Pipe:flush(),
    Pipe:close(),!.

Python code: ( to read from the pipe )

import os, time, sys


pipe_name = 'pipe_vp_read'

def paread( ):
pipein = open(pipe_name, 'r')
while True:
print 'begin read '
line = pipein.readline()[:-1]
print 'Parent %d got "%s" at %s' % (os.getpid(), line, time.time( ))

paread()


Python exits with :

pipein = open(pipe_name, 'r')
IOError: [Errno 2] No such file or directory: 'pipe_vp_read'
Back to top
View user's profile Send private message
Thomas Linder Puls



Copenhagen, Denmark
Joined: 28 Feb 2000
Posts: 3104

PostPosted: 31 Aug 2017 13:16    Post subject: Reply with quote

A pipe name has the form \\<server>\pipe\<name>.

The server side of a pipe is always on the machine that opens it, so it must have the form \\.\pipe\<name>. pipeStream::makeLocalPipeName creates such a name.

If your python code is running on the same computer (which I believe it is) then it should also use the pipe name \\.\pipe\<name>

See also Pipe Names.

_________________
Regards Thomas Linder Puls
Prolog Development Center
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    discuss.visual-prolog.com Forum Index -> Visual Prolog All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum