Search code examples
pythonfilterwxpythonobjectlistviewsniffer

Filtering ObjectListView - Python


I'm using ObjectListView and I want to know if I can filter it by it's attributes. I'm using scapy to build a sniffer so I show all the packets in an ObjectListView, each row is a PacketObject that has an attribute called packet. Let's say I want to Filter by TCP, so I need the packet of the objects to contain TCP. I saw a way to filter by the information that is shown on the ObjectListView but I need to filter by attributes.


Solution

  • ObjectListView has filtering built-in to the widget:

    You do have to set up the filter yourself. You can get some ideas by looking at the C++ docs for the widget as they actually have some filtering examples: