You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

15 lines
459 B

# -*- coding: utf-8 -*-
import ast
import io
import sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
path = r'd:\code\crm-backend-matt\.scratch\opportunity-acceptance\accept-selftest.py'
src = open(path, encoding='utf-8').read()
print('lines:', src.count('\n') + 1, 'chars:', len(src))
print('has fstring:', "f'" in src or 'f"' in src)
ast.parse(src)
print('syntax OK')
b = open(path, 'rb').read(3)
print('BOM:', b == b'\xef\xbb\xbf')