File: demo08.py

package info (click to toggle)
python-colorama 0.4.6-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 448 kB
  • sloc: python: 1,428; sh: 49; makefile: 41
file content (15 lines) | stat: -rw-r--r-- 344 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from __future__ import print_function
import fixpath
from colorama import colorama_text, Fore


def main():
    """automatically reset stdout"""
    with colorama_text():
        print(Fore.GREEN + 'text is green')
        print(Fore.RESET + 'text is back to normal')

    print('text is back to stdout')

if __name__ == '__main__':
    main()