(Sep-21-2019, 03:37 PM)newbieAuggie2019 Wrote: The f-string formatting seems to be the advisable choice since Python 3.6, so I want to be able to learn properly about them.You should learn
f-string
without mixing in termcolor cprint().cprint() takes different argument to function,not so much sense with all arguments to try to make it in one line.
>>> help(cprint) Help on function cprint in module termcolor: cprint(text, color=None, on_color=None, attrs=None, **kwargs) Print colorize text. It accepts arguments of print function.The text part can manipulate with f-sting,the other arguments to make it all in line dos not make so much sense here.
import sys from termcolor import colored, cprint cprint('\nThis is ', end='') cprint(f'{"dangerous".upper():~^20}', 'green', attrs=['reverse', 'blink'], end='') cprint('... for my mental health!', end='\n\n')