dyad icon indicating copy to clipboard operation
dyad copied to clipboard

Python compatible?

Open lab313ru opened this issue 7 years ago • 2 comments

Hi. Is it possible to use Python sockets to contact with C side that uses dyad?

lab313ru avatar May 14 '17 10:05 lab313ru

Yes — If you build and run the echo server example, the following python script could be used on the same machine to connect to it:

import socket

s = socket.socket()
s.connect(("localhost", 8000))

s.send("Hello world\n")

print(s.recv(100))

rxi avatar May 14 '17 11:05 rxi

You can write methods in c that are wrapped using the CPython API, therefore you can call those methods straight in python.

cmarshall108 avatar May 14 '17 13:05 cmarshall108