old_contents: import os
  import sys
  from malware import utils
  
  
  def get_pcap_list(path):
      pcap_list = []
      dirs = os.listdir(path)
      dirs.sort()
      for item in dirs:
          if item.split('.')[-1] == 'pcap':
              pcap_list.append(item)
      return pcap_list
  
  if __name__ == '__main__':
      pcap_list = get_pcap_list(sys.argv[1])
      for pcap in pcap_list:
          connection = utils.follow_tcp_stream(sys.argv[1] + '/' + pcap)
          utils.dump_tcp_stream_content(connection)
  
new_contents: import os
  import argparse
  from malware import utils
  from pprint import pprint
  
  parser = argparse.ArgumentParser(description='''This is a packet reconstruct
                                   tool to help reconstruct
                                   the packet payload.''')
  parser.add_argument("-d", "--directory", type=str,
                      help="Specify a path which place pcap file")
  args = parser.parse_args()
  
  
  def get_pcap_list(path):
      pcap_list = []
      dirs = os.listdir(path)
      dirs.sort()
      for item in dirs:
          if item.split('.')[-1] == 'pcap':
              pcap_list.append(item)
      return pcap_list
  
  if __name__ == '__main__':
      pcap_list = get_pcap_list(args.directory)
      for pcap in pcap_list:
          connection = utils.follow_tcp_stream(args.directory + '/' + pcap)
          utils.dump_tcp_stream_content(connection)
          pprint(connection)
  
subject: Add argparse and pprint