Hi hope someone on here can help me, I’m trying to write a python script using vim as the IDE then after saving changes and exiting running the code in the terminal:
#!/usr/bin/python
import sys
# then we import scapy:
from scapy.all import *
def PacketHandler(pkt):
print pkt.summary()
return
sniff(iface=sys.argv[1],count= int(sys.argv[2], prn= PacketHandler)
But, I’m getting a syntax error:
File "./packethandler.py", line 10
sniff=(iface =sys.argv[0], count =int(sys.argv[1]), prn =PacketHandler)
SyntaxError: invalid syntax
I can’t see anything wrong with the code, Does anyone maybe see something I’m missing ?
Thanks the Duke
#!/usr/bin/python
import sys
# then we import scapy:
from scapy.all import *
def PacketHandler(pkt):
print pkt.summary()
return
sniff(iface=sys.argv[1],count= int(sys.argv[2], prn= PacketHandler)
But, I’m getting a syntax error:
File "./packethandler.py", line 10
sniff=(iface =sys.argv[0], count =int(sys.argv[1]), prn =PacketHandler)
SyntaxError: invalid syntax
I can’t see anything wrong with the code, Does anyone maybe see something I’m missing ?
Thanks the Duke


