def wireshark ( pktlist , * args ) : fname = get_temp_file ( ) wrpcap ( fname , pktlist ) subprocess . Popen ( [ conf . prog . wireshark , "-r" , fname ] + list ( args ) )
ive packet capture and create pcap using pyshark in python
Run wireshark on a list of packets
def wireshark(pktlist, *args):
    """Run wireshark on a list of packets"""
    fname = get_temp_file()
    wrpcap(fname, pktlist)
    subprocess.Popen([conf.prog.wireshark, "-r", fname] + list(args))