forked from hamano/python-erlang-interface
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
51 lines (40 loc) · 992 Bytes
/
README
File metadata and controls
51 lines (40 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
PyErl
=====
PyErl is Erlang Interface for Python. which help you integrate
programs written in Python and Erlang.
DEPENDENCIES
------------
This module requires these other modules and libraries:
Erlang/OTP R12 or later
In debian:
apt-get install erlang-dev
INSTALL
-------
python setup.py build
python setup.py install
EXAMPLE
-------
* make erlang terms
import pyerl
atom = pyerl.mk_atom("hello")
string = pyerl.mk_string("world")
int = pyerl.mk_int(-1)
list = pyerl.mk_list([atom, string, int])
print list
* call rpc
# just call pingpong:ping() in node2@localhost
import pyerl
host = "localhost"
name = "node1"
node = name + "@" + host
cookie = "TESTCOOKIE"
pyerl.connect_xinit(host, name, node, "127.0.0.1", cookie, 1)
pyerl.xconnect("127.0.0.1", "node2")
atom = pyerl.mk_atom("ping")
args = pyerl.mk_list([atom]);
eterm = pyerl.rpc(sock, "pingpong", "ping", args);
pyerl.close_connection(sock);
print eterm
AUTHER
------
Tsukasa Hamano <code@cuspy.org>