Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tokenize
- with open('input.txt', 'rb') as input_file, \
- open('output.txt', 'w') as output_file:
- for (ttype, tstring, *_) in tokenize.tokenize(input_file.readline):
- if ttype == tokenize.COMMENT:
- print(tstring, file=output_file)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement