Create Lexical Analyzer using python