Skip to content

Instantly share code, notes, and snippets.

@ibizaman
Created April 17, 2014 15:11
Show Gist options
  • Select an option

  • Save ibizaman/10990839 to your computer and use it in GitHub Desktop.

Select an option

Save ibizaman/10990839 to your computer and use it in GitHub Desktop.
>>> tokenize("from future import feature")
[('NAME', 'f'), ('NAME', 'r'), ('NAME', 'o'), ('NAME', 'm'), ('SPACE', ' '), ('NAME', 'f'), ('NAME', 'u'), ('NAME', 't'), ('NAME', 'u'), ('NAME', 'r'), ('NAME', 'e'), ('SPACE', ' '), ('NAME', 'i'), ('NAME', 'm'), ('NAME', 'p'), ('NAME', 'o'), ('NAME', 'r'), ('NAME', 't'), ('SPACE', ' '), ('NAME', 'f'), ('NAME', 'e'), ('NAME', 'a'), ('NAME', 't'), ('NAME', 'u'), ('NAME', 'r'), ('NAME', 'e'), ('ENDMARKER', ''), None]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment