
import compileall
import io
import sys, os

def run():
  dirs = sys.argv[1:]
  if (len(dirs) == 0):
    dirs = [os.getcwd()]
  sys.stdout = io.StringIO()
  sys.stderr = io.StringIO()
  for dir in dirs:
    compileall.compile_dir(dir, 100)

if (__name__ == "__main__"):
  run()
