Skip to content
python-csp provides python with communicating sequential processes style parallelism
Branch: master
Clone or download
snim2 Merge pull request #22 from fsouza/master
os_process: fix debug messages
Latest commit 1f96b76 Oct 26, 2012
Type Name Latest commit message Commit time
Failed to load latest commit information.
IRClogs Added IRC log of Europython sprint discussions. Jul 27, 2010
applications Imported old SVN code Dec 14, 2009
benchmark BUGFIX: Now importing time module correctly Jan 7, 2012
csp os_process: fix debug messages Oct 24, 2012
docs Documentation clean-up. Need a script to convert Google Wiki syntax t… Jul 28, 2010
examples Make all the Mandelbrot programs executable. Aug 23, 2012
exstatic Issue 41 again, all files not have Python 3 style string formatting. Jul 28, 2010
logo Added a square version of the logo (needed by Google Groups front page). Jul 27, 2010
rst Added wiki files from old Google Code repository. FIXME: These need t… Oct 3, 2012
scripts Fixed Issue 29: documentation in python-csp shell, not in core librar… Jul 28, 2010
test Added context manager to provide OCCAM-like syntax for python-csp. Oct 17, 2010
tutorial Added test for repetition; files for part08 of tutorial. Jul 27, 2010
.hgignore Ignore the generated image for the Mandelbrot set programs for Mercur… Aug 23, 2012
ChangeLog Added static checker to determine whether a process correctly uses its May 8, 2010
LICENSE Imported old SVN code Dec 14, 2009 Added static checker to determine whether a process correctly uses its May 8, 2010
Makefile Rationalised README files and moved to github flavoured markdown. FIX… Oct 3, 2012
make.bat Moved initial docs to Sphinx. RST files need elaborating. Apr 9, 2010 Fixed bug in tokenring benchmark. Jul 23, 2010
setup.cfg Minor documentation changes, now based on PIP / paste. Jytho… Apr 9, 2010 Fix 2to3 todos: parameter unpacking and shabang line not refer to pyt… Jul 22, 2010

python-csp: Communicating Sequential Processes for Python

Copyright (C) Sarah Mount, 2009 under the GNU GPL v2. See the file LICENSE for more details.


python-csp can be installed using PIP (PIP Installs Python):

$ sudo pip install python-csp

or from a source distribution using

$ sudo python install


python-csp adds C.A.R. (Tony) Hoare's Communicating Sequential Processes to Python. A brief example:

>>> @process
... def writer(channel, n):
...      for i in xrange(n):
...              channel.write(i)
...      channel.poison()
...      return
>>> @process
... def reader(channel):
...      while True:
...              print
>>> chan = Channel()
>>> Par(reader(chan), writer(chan, 5)).start()


There are several sources of documentation for python-csp:

  • If you are running the python-csp shell, type "info csp" to list available in-shell help.

  • A user guide exists in the tutorial/ directory of the source.

  • examples/ contains some larger example programs.


S. Mount, M. Hammoudeh, S. Wilson, R. Newman (2009) CSP as a Domain-Specific Language Embedded in Python and Jython. In Proceedings of Communicating Process Architectures 2009. Eindoven, Netherlands. 1st -- 4th November 2009. Published IOS Press.

You can’t perform that action at this time.