Re: parallel/concurrent process in python

2009-03-10 Thread Minesh Patel
> os.fork is not cross platform.  It is *nix only.  Subprocess runs on > Windows also.  The OP never specified his platform. > Just out of curiosity, how is one able to replace an os.fork() call with subprocess and have the child execute multiple statements? I typically see subprocess used for spa

Re: parallel/concurrent process in python

2009-03-10 Thread Ommer . Simjee
On Mar 10, 10:06 am, Minesh Patel wrote: > On Mon, Mar 9, 2009 at 2:47 PM,   wrote: > > I'm trying to figure out parallel process python code. Something > > similar to fork funtion in C. > > > For example, I using sniff tool in scapy to capture packets but i want > > this to run in the background:

Re: parallel/concurrent process in python

2009-03-10 Thread cgoldberg
> Why not use os.fork(), it is the same as C's fork? os.fork is not cross platform. It is *nix only. Subprocess runs on Windows also. The OP never specified his platform. -Corey -- http://mail.python.org/mailman/listinfo/python-list

Re: parallel/concurrent process in python

2009-03-10 Thread Minesh Patel
On Mon, Mar 9, 2009 at 2:47 PM, wrote: > I'm trying to figure out parallel process python code. Something > similar to fork funtion in C. > > For example, I using sniff tool in scapy to capture packets but i want > this to run in the background: > > --- > from scapy.all import * > import subp

parallel/concurrent process in python

2009-03-09 Thread Ommer . Simjee
I'm trying to figure out parallel process python code. Something similar to fork funtion in C. For example, I using sniff tool in scapy to capture packets but i want this to run in the background: --- from scapy.all import * import subprocess import netsnmp pkts=sniff(iface="eth0",filter="UD