Files
example-code-2e/04-text-byte/stdout_check.py
2020-02-19 00:10:33 -03:00

19 lines
410 B
Python

import sys
from unicodedata import name
print(sys.version)
print()
print('sys.stdout.isatty():', sys.stdout.isatty())
print('sys.stdout.encoding:', sys.stdout.encoding)
print()
test_chars = [
'\u2026', # HORIZONTAL ELLIPSIS (in cp1252)
'\u221E', # INFINITY (in cp437)
'\u32B7', # CIRCLED NUMBER FORTY TWO
]
for char in test_chars:
print(f'Trying to output {name(char)}:')
print(char)