colors - Different coloured print strings in python - IDLE -
using idle create short, basic text adventure game, methods try work in other editors such repl.it or canopy, rather use of idle simplicity of it, , doesn't require internet connection access.
i won't mention methods tried, may have been approaching them in entirely wrong way, or maybe idle doesn't have functionality of other editors, wan't make text in game clearer distinguish, example below short segment
import time print ("welcome traveller!") time.sleep(1) def name_identify(): print () name_input = input ("what name? ").lower() name_input = name_input.title() time.sleep(0.75) def name_confirm(): print () print ("so %s name then?" % name_input)
where questions such as
name_input = input ("what name? ").lower() appearing in different colour, or bold/italic even. things similar to
print ("\x1b[3mhello world\x1b[23m")
and
print ("\033[1;31m""hello world")
don't work, assume function not naturally supported, ask, if possible either a, make supported, method, or similar work, or b, option make changes @ least similar seek?
it helpful if provide me way this, or @ least editor close in simplicity (design wise) idle , support functions seek. version of python using 3.6.1
thanks in advance, , apologise if wording confuses you, ask confused , attempt clarify. using windows idle shell.
i know going through right now, there no benefit make text colored or bold in python without gui. if somehow manage it turn normal text when make file exe format. have wasted week on this.
it makes sense when reach gui programming. tkinter place start.
its not matter on ide on compiler.
in tkinter matter of seconds
lab_practice = label(text = "practice",fg = "red#the foreground color",bg = "yellow",font = ("arial",40))
Comments
Post a Comment