Checking Comments

Moshe Zadka moshez at
Sat Apr 29 07:32:03 EDT 2000

Here's a small script I use to check the comments in a file. It is a nice
tools for Py-teachers, to check students comment their code enough.

Here it is, in all it's glory:

================ cut here =========================
# Released to the Public Domain by Moshe Zadka 
# on 29.4.2000
import sys, tokenize

def print_if_comment(type, token, *args):
        if type==tokenize.COMMENT:

tokenize.tokenize(sys.stdin.readline, print_if_comment)
====================== cut here ==================

use-and-enjoy-ly y'rs, Z.
Moshe Zadka <mzadka at>. -- we put the penguin in .com

More information about the Python-list mailing list