import py_compile import sys paths = [ 'src/ui/widgets/new_edition_check.py', 'src/utils/icon.py', 'src/ui/widgets/graph.py', 'src/ui/userInterface.py', 'src/ui/dialogs/mailTemplate.py', 'src/services/catalogue.py', 'src/backend/catalogue.py', 'src/parsers/xml_parser.py', 'src/parsers/csv_parser.py', 'src/parsers/transformers/transformers.py', 'src/core/semester.py', ] errs = 0 for p in paths: try: py_compile.compile(p, doraise=True) print('OK:', p) except Exception as e: print('ERROR:', p, e) errs += 1 sys.exit(errs)