import ast, sys files = ['price_monitor', 'strategy_feedback', 'system_health_check', 'mo_config', 'mofin_health'] ok = True for f in files: p = f'/home/hmo/MoFin/deploy/profile-scripts/{f}.py' try: ast.parse(open(p).read()) print('OK', f) except SyntaxError as e: print('FAIL', f, e) ok = False sys.exit(0 if ok else 1)