string - Python - How to replace numbers variables -


how replace numbers variables ?

works..

print("\033[1;1h text")  

not works..

x=10 y=20 print("\033[x;yh text") 

or how else it? thank yout

are looking build string values of variables? can use format this

>>> x = 10 >>> y = 20 >>> '\033[{};{}h text'.format(x, y) '\x1b[10;20h text' 

edit:

regarding how replace text can same thing above

'\033[{};{}h {}'.format(x, y, array[i]) 

Comments

Popular posts from this blog

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -