Working on Python 2.7

Asked

Viewed 48 times

1

How do I make an item bold? print ('Company Soon Young Viana') how do I insert an income tax spreadsheet? print ('PRODUCT'' t'u'UNIT PRICE'' t'QUANTITY'' t'u'TOTAL PRICE'' t''ICMS')

1 answer

0

Install the Termcolor: Termcolor

import sys
from termcolor import colored, cprint

    text = colored('Hello, World!', 'red', attrs=['reverse', 'blink'])
    print(text)
    cprint('Hello, World!', 'green', 'on_red')

    print_red_on_cyan = lambda x: cprint(x, 'red', 'on_cyan')
    print_red_on_cyan('Hello, World!')
    print_red_on_cyan('Hello, Universe!')

    for i in range(10):
        cprint(i, 'magenta', end=' ')



    cprint("Attention!", 'red', attrs=['bold'], file=sys.stderr)

should work

  • Hello. This way is not working, I already tried. appears the following:

  • [1mHello World ! [0m

  • It didn’t work for me either (Windows 7)... This solution wouldn’t be restricted to POSIX environments?

  • edited the answer

Browser other questions tagged

You are not signed in. Login or sign up in order to post.