I am trying to simulate a a network consisting of several clients and servers. I have written node.py which contains client-server code. I want to run multiple instances node.py. But I don’t want to do it manually so I have written another file spawn.py which spawns multiple instances of node.py using fork and exec. However, I need to run each instance of node.py on different terminal(shell) so that I can easily debug what is happening inside each node.
How can we do that? Please help.
EDIT : I am working on linux and using python 2.5 and
I want to run all processes on the same box
If you want “real” (pseudo-;-) terminals, and are using X11 (almost every GUI interface on Linux does;-), you could exec
xterm -e python node.pyinstead of justpython node.py— substitute forxtermwhatever terminal emulator program you prefer, of course (I’m sure they all have command-line switches equivalent to good old xterm’s-e, to specify what program they should run!-).