Ask coding questions

← Back to all posts
How do i separate
gameprogammer (6)

I am creating a among us game but you can't actually play it.You can watch the bots play it.I made the characters and i made a character that is red : def red(words):
print(Fore.GREEN, Style.BRIGHT + 'Player: ' + words)
And whenever i put "there is 1 imposter among us..."(I put red before it so the color scheme can be red) it shows "red" is saying it. I want the font to be red. not red saying"there is 1 imposter among us..." how do i make it so that it is red and red is still a player? i removed red and then it works. and no i can not change red's color. so how do i keep both of them in the code?

robowolf (548)

Hmm maybe use termcolor to customize that one text. Just do

from termcolor import colored
print(colored('An impostor is among us','red'))

That should solve your problem.

gameprogammer (6)

@robowolf well then the out put is going to be : There is 1 imposter among us. And then it will show syntax error.And i don't have termcolor import i have colorama import

gameprogammer (6)

@robowolf Thanks for the advice though

robowolf (548)

@gameprogammer Couldn't you import termcolor? It's as simple as doing it in the repl itself

gameprogammer (6)

@robowolf Something other than termcolor, it doesn't work.

gameprogammer (6)

you can fork it and changeone of the characters color to red and run it it will show red saying it even though the color is supposed to be red.