Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

opening a pcap file in python

Tags:

python

I'm trying to open a .pcap file in python. can anyone help with this? each time I try this, it gives an error message that "IOError: [Errno 2] No such file or directory: 'test.pcap'"

import dpkt
f = open('test.pcap')
pcap = dpkt.pcap.Reader(f)
like image 507
hollandspur Avatar asked Mar 12 '26 15:03

hollandspur


1 Answers

Try giving open() the correct path to test.pcap:

f = open(r'C:\Users\hollandspur\Documents\test.pcap')

or some such...

like image 189
Tim Pietzcker Avatar answered Mar 15 '26 04:03

Tim Pietzcker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!