print('Remaining subprocesses', subprocesses)


class Test:

    def run(self):
        for i in range(0, max_processes):
            pp = MyPP()
command = ['sleep', '3']
subprocess = reactor.spawnProcess(pp, command[0], command, {})
subprocesses[subprocess.pid] = subprocess
Test().run()
reactor.run()
simple example with spawnProcess