def main():
    """The main function of the script"""
    desc = 'Generate character statistics from a source tree'
    parser = argparse.ArgumentParser(description=desc)
    parser.add_argument(
        '--src',
        dest='src',
        required=True,
        help='The root of the source tree'
    )
    parser.add_argument(
        '--out',
        dest='out',
        default='chars.py',
        help='The output filename'
    )

    args = parser.parse_args()

    stats = generate_statistics(args.src)
    with open(args.out, 'wb') as out_f:
        out_f.write('CHARS={0}\n'.format(stats))
def main ( ) : desc = 'Generate character statistics from a source tree' parser = argparse . ArgumentParser ( description = desc ) parser . add_argument ( '--src' , dest = 'src' , required = True , help = 'The root of the source tree' ) parser . add_argument ( '--out' , dest = 'out' , default = 'chars.py' , help = 'The output filename' ) args = parser . parse_args ( ) stats = generate_statistics ( args . src ) with open ( args . out , 'wb' ) as out_f : out_f . write ( 'CHARS={0}\n' . format ( stats ) )
The main function of the script