title: Open and reading multiple pcap files
body: <p>I'm trying to find out how I can use the dpkt module to open <strong>multiple</strong> .pcap files and read them at the <strong>same</strong> time. After much googling and many long hours, the examples which I manage to find only shows how you can open and read 1 .pcap file.</p>
  
  <p>I've tried using more than 1 for loop, and to zip() the files using an array but to no avail. There is an error, ValueError: need more than 1 value to unpack. Any suggestions? Here is my current python script:</p>
  
  <pre><code>  import dpkt, socket, glob, pcap, os
  
      files = [open(f) for f in glob.glob('*.pcap')]
      abc = dpkt.pcap.Reader(file("abc.pcap", "rb"))
      fgh = dpkt.pcap.Reader(file("fgh.pcap", "rb"))
  
      print files
      print "\r\n"
      List = [abc, fgh]
  
      for ts, data in zip(List):
         eth = dpkt.ethernet.Ethernet(data)
         ip = eth.data
         tcp = ip.data
  
         src = socket.inet_ntoa(ip.src)
         dst = socket.inet_ntoa(ip.dst)
  
         if tcp.dport == 80 and len(tcp.data) &gt; 0:
            http = dpkt.http.Request(tcp.data)
            print "-------------------"
            print "HTTP Request /", http.version
            print "-------------------"
            print "Type: ", http.method
            print "URI: ", http.uri
            print "User-Agent: ", http.headers ['user-agent']
            print "Source: ", src
            print "Destination: ", dst
            print "\r\n"
  </code></pre>
  
  <p><strong>EDIT://</strong></p>
  
  <p>Hey, thanks for all the suggestions. In order to simplify the process, I've modified my code to open .txt files for now. My code is found below as indicated. There is no error as shown in the output, but how do I get rid of the new lines symbol '\n', the brackets and the single quotes when I print the output?</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code> import glob
  
      fileList = [glob.glob('*.txt')]
  
      for files in fileList:
         print "Files present:",files
         print ""
  
         a = open("1.txt", 'r')
         b = open("2.txt", 'r')
  
         List = [a,b]
  
         for line in zip(*List):
            print line
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>&gt;Files present: ['2.txt', '1.txt']
  &gt;
  &gt;('This is content from the FIRST .txt file\n', 'This is content from the SECOND .txt file\n')
  &gt;('\n', '\n')
  &gt;('Protocol: Testing\n', 'Protocol: PCAP\n')
  &gt;('Version: 1.0\n', 'Version: 2.0\n')
  </code></pre>