geekscrap
geekscrap

Reputation: 1045

Best method of importing scapy

I've used: from scapy.all import * in the past however now I am getting conflicts (Queue) within the namespace.

Whats the best method to import scapy? Methods I've looked into:

import scapy
import scapy.all
from scapy import all

Upvotes: 6

Views: 5511

Answers (3)

1cedsoda
1cedsoda

Reputation: 642

from scapy.all import srp,Ether,ARP,conf,send,arping

Upvotes: 1

Pierre
Pierre

Reputation: 6237

I often use, when I do not want to overwrite my namespace:

from scapy import all as scapy

After that everything is accessible under scapy.:

scapy.send(scapy.IP()/scapy.ICMP())

Upvotes: 5

geekscrap
geekscrap

Reputation: 1045

from scapy.all import sr1,IP,ICMP

Is probably the best way of doing this.

To import all the layers at once (to test packets against them) use:

from scapy.layers import all

Upvotes: 2

Related Questions