📜  python 颜色输入 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:06.267000             🧑  作者: Mango

代码示例1
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)