# L-22 MCS 275 Wed 5 Mar 2008 : listpyfields.py

import os
from grabpyhead import EnumFields

def PrintFields(s):
   """
   Use as argument to test the enumerator.
   """
   print s

def main():
   """
   Prints the header of all .py files
   in the current directory.
   """
   p = os.getcwd()
   os.chdir('../MCS275py')
   n = EnumFields('.',PrintFields)
   print 'counted %d .py files' % n
   os.chdir(p)

if __name__ == "__main__": main()
