Skip to content

Instantly share code, notes, and snippets.

@sebdah
sebdah / threading_example.py
Last active July 18, 2024 14:35
Running a background thread in Python
import threading
import time
class ThreadingExample(object):
""" Threading example class
The run() method will be started and it will run in the background
until the application exits.
"""
@franquis
franquis / IEEEOUIparser.py
Created October 18, 2013 08:45
Parsing IEEE OUI with Python
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import urllib2, re
def ParseIEEEOui(url = "http://standards.ieee.org/develop/regauth/oui/oui.txt"):
req = urllib2.Request(url)
res = urllib2.urlopen(req)
data = res.read()
IEEOUI = []
for line in data.split('\n'):