0
from scapy.all import *
pkts = rdpcap("lalalao2.pcap")
#time slice de t em segundos : 10 minutos
t = 600
somaMin = pkts[0].time + t
valores=[]
for p in pkts:
if p<=somaMin:
valores.append(p)
else:
primslice =valores
f=open("time1.txt",'w')
f.writelines(primslice)
valores=[]
valores.append(p)
somaMin=p.time + t
The above code opens a network dump file (PCAP) and creates vectors containing time Slices of t seconds. I would like each team Slice to be recorded in a different text file: time1, time2, ... The problem is that I do not know how many schools I will have, because it depends on the capture. It is possible?
about the note is just put what’s left out of the loop and write to another file
– ederwander
Which is exactly what I said, isn’t it?
– Woss
@Anderson Carlos Woss, thank you. I will study the code here!
– Ed S