<commit_before>from scapy.all import *

def printType(element):
   i=0
   while i<100:
     try:
       print element.type
       i+=1
     except:
       i+=1

def main():
path = raw_input('Enter the path of the pcap file you want to read: ')
a = rdpcap(path)
printType(a)

main() 
   
   
<commit_msg>added exception handling to reading pcap file<commit_after>from scapy.all import *

def printType(element):
   i=0
   while i<100:
     try:
       print element.type
       i+=1
     except:
       i+=1

def main():
path = raw_input('Enter the path of the pcap file you want to read: ')
try:
   a = rdpcap(path)
except:
  print 'Error opening the pcap file'
printType(a)

main() 
   
   

{'fraction_non_alphanumeric': 0.10404624277456648, 'fraction_numerical': 0.017341040462427744, 'mean_word_length': 2.5721649484536084, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5761309', 'n_tokens_mistral': 252, 'n_tokens_neox': 245, 'n_words': 78}