I'm trying to make some code that allows me to replace a character in a list where the position is defined by an integer. I have the following code
# -*- coding: utf-8 -*-
a = 47
text = 'xxxxxxxxxx xxxxx ╟───┼────┼────┼────┼────┼────┼────┼────┼────┼────┼────┼───╢ xx'
new = list(text)
new[a] = "x"
print ''.join(new)
But when I run it, it prints out
xxxxxxxxxx xxxxx ╟───┼────┼x▒▒───┼────┼────┼────┼────┼────┼────┼────┼────┼───╢ xx
Instead of
xxxxxxxxxx xxxxx ╟───┼────┼x──┼────┼────┼────┼────┼────┼────┼────┼────┼───╢ xx
In other words it includes the "▒▒" in the printed string. It adds extra characters regardless of which character is replaced in the list. What am I doing wrong?
I'm running it on a raspberry pi connected via SSH using putty.