> 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
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:
> 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
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
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