Skip to content

Instantly share code, notes, and snippets.

@bmwant
Created April 3, 2018 08:39
Show Gist options
  • Save bmwant/b82bb1a96de976cef66554ee115829a4 to your computer and use it in GitHub Desktop.
Save bmwant/b82bb1a96de976cef66554ee115829a4 to your computer and use it in GitHub Desktop.
Just share some code
from html.parser import HTMLParser
class MyBase(object):
def __init__(self):
print('I want this called')
class MyParser(HTMLParser, MyBase):
def __init__(self):
super().__init__()
print('Yes, init works')
self.parser_val = None
def handle_starttag(self, tag, attrs):
pass
def handle_data(self, data):
pass
def handle_endtag(self, tag):
pass
def main():
mp = MyParser()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment