This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import HTMLParser | |
import re | |
import MySQLdb | |
htmlparser = HTMLParser.HTMLParser() | |
numwords = 2 | |
db = MySQLdb.connect(host="localhost", user="root", passwd="", db="wiki1") | |
cur = db.cursor() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import HTMLParser | |
import re | |
htmlparser = HTMLParser.HTMLParser() | |
numwords = 2 | |
def main(filename): | |
with open(str(filename)) as infile: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _getName(self): | |
retmod = "Module" | |
frame, module, line, function, context, index = inspect.stack()[2] | |
try: | |
self_argument = frame.f_code.co_varnames[0] # this should be self | |
instance = frame.f_locals[self_argument] | |
retmod = instance.__class__.__name__ | |
except IndexError: | |
retmod = inspect.getmodulename(module) | |
return retmod |
NewerOlder