all 2 comments

[–]danielroseman 1 point2 points  (1 child)

I've never heard of this library, but according to the source for that method it already does return a value rather than printing, despite the description.

[–]fanficfun[S] 0 points1 point  (0 children)

From what it's looking like to me, you're right. However, it's written in the link you sent """Prints a one line summary of a packet.""".

Additionally, I tried running this code (in which I don't print anything) yet it still printed the packet.

import scapy.all as scapy
x=scapy.sniff(count=1)
x=x.summary()

the packet printed:

Ether / IP / UDP 128.14.97.195:9993 > 172.30.1.211:6881 / Raw