use_ansi_codes.py (313B)
1 #!/usr/bin/env python3 2 # Copyright 2015 The Chromium Authors 3 # Use of this source code is governed by a BSD-style license that can be 4 # found in the LICENSE file. 5 """Prints if the the terminal is likely to understand ANSI codes.""" 6 7 8 import os 9 10 # Add more terminals here as needed. 11 print('ANSICON' in os.environ)