title: why is my Python program slowing down my computer
body: <p>I have a small program in python that collect probe requests and send ssids and macs to a server. But it slows down my computer after few minutes. I have tried to add dict so that I will make a POST only when it is necessary. 
  But the problem still the same: after few minutes, my computer is slowing down. I have tried also with raspberry pi and the result is the same.</p>
  
  <p>Please tell me what is wrong here.</p>
  
  <p>this is the code</p>
  
  <pre><code>#!/usr/bin/env python
  from scapy.all import *
  import json
  import requests
  
  
  macSsid = {}
  def handler(pkt):
     url = 'http://10.10.10.10:3000/ssids'
     headers = {'content-type': 'application/json'}
     if pkt.haslayer(Dot11):
        if pkt.type == 0 and pkt.subtype == 4:
           if pkt.info :
              print "Client MAC = %s probe request =%s" % (pkt.addr2, pkt.info)
              if pkt.addr2 not in  macSsid:
                 macSsid[pkt.addr2] = []
                 macSsid[pkt.addr2].append(pkt.info)
                 r = requests.post(url, data = json.dumps({"mac": pkt.addr2, "ssid": pkt.info }), headers = headers)
              else:
                 if pkt.info not in  macSsid[pkt.addr2]:
                    macSsid[pkt.addr2].append(pkt.info)
                    r = requests.post(url, data = json.dumps({"mac": pkt.addr2, "ssid": pkt.info }), headers = headers)
  
  
  while 1:
      try:
         exc_info = sys.exc_info()
         sniff(iface="mon0", prn = handler)
      except Exception, err:
         traceback.print_exception(*exc_info)  
  </code></pre>
  
  <p>Please tell me what is wrong here.</p>