Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Python compatible? #17

Open
lab313ru opened this issue May 14, 2017 · 2 comments
Open

Python compatible? #17

lab313ru opened this issue May 14, 2017 · 2 comments

Comments

@lab313ru
Copy link

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

@rxi
Copy link
Owner

rxi commented May 14, 2017

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))

@cmarshall108
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants