Created
March 13, 2014 01:50
-
-
Save rsyring/9520549 to your computer and use it in GitHub Desktop.
parse python source for comments
This file contains 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 test_noqa_lines(codeString): | |
g = tokenize.generate_tokens(StringIO(codeString).readline) # tokenize the string | |
for toknum, tokval, srow, _, _ in g: | |
if toknum == N_TOKENS: | |
pass # do something |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment