Oct-12-2018, 03:44 PM
Hello,
How would I colored input prompt? I know how to when printing but not input.
I got this so far.
I get the following error when running this code:
Please help.
Thank You.
How would I colored input prompt? I know how to when printing but not input.
I got this so far.
from colorama import init from termcolor import colored init() def computer_prompt(): return (colored('Computer: ', 'green', 'on_blue')) def user_prompt(): return (colored('User: ', 'yellow', 'on_blue')) print(computer_prompt()+'Please enter a word.') word = input(user_prompt()+('?: ')) print(word)You can see that 'Computer: ' returns with green text but how do I color the 'User: ' input?
I get the following error when running this code:
Error:<-[44m<-[33m?: <-[0m?:
I thought it was as easy as creating a function like computer_prompt but I just couldn't get the result I was looking for.Please help.
Thank You.