json pub sub
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
jps
samples
test
.gitignore
.travis.yml
LICENSE
README.md
setup.py

README.md

jps

jps is simple pub/sub system for python(v2.7 is supported now). It is very easy to install and it is easy to understand if you have experience of ROS(Robot Operating System).

see http://jps.readthedocs.org/

Build Status

Install

$ sudo pip install jps

If it fails, try below.

sudo apt-get install python2.7-dev

Publisher

publisher.py

import jps
import time

pub = jps.Publisher('/hoge1')
i = 0
while True:
    pub.publish('hello! jps{0}'.format(i))
    i += 1
    time.sleep(0.5)

Subscriber

subscriber.py

import jps
for msg in jps.Subscriber('/hoge1'):
    print msg

How to Run

You need three consoles.

$ jps_master
$ python publisher.py
$ python subscriber.py