demos/demo08.py
raw| 1 | from __future__ import print_function |
| 2 | import fixpath |
| 3 | from colorama import colorama_text, Fore |
| 4 | |
| 5 | |
| 6 | def main(): |
| 7 | """automatically reset stdout""" |
| 8 | with colorama_text(): |
| 9 | print(Fore.GREEN + 'text is green') |
| 10 | print(Fore.RESET + 'text is back to normal') |
| 11 | |
| 12 | print('text is back to stdout') |
| 13 | |
| 14 | if __name__ == '__main__': |
| 15 | main() |