File: create_loop.py

package info (click to toggle)
pprocess 0.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 404 kB
  • ctags: 440
  • sloc: python: 2,048; makefile: 106; sh: 41
file content (18 lines) | stat: -rw-r--r-- 355 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python

from pprocess import create

limit = 100
channel = create()
if channel.pid == 0:
    i = channel.receive()
    while i < limit:
        print i
        i = channel.receive()
    channel.send("Done")
else:
    for i in range(0, limit + 1):
        channel.send(i)
    print channel.receive()

# vim: tabstop=4 expandtab shiftwidth=4