I am a beginner Python programmer and I wanted to use this character: █. I have tried just doing: print "█"
but I always got an error. I Have looked for solutions, but have found nothing that helped me.
Asked
Active
Viewed 139 times
-1

Dylanica
- 19
- 3
-
1So what error do you get? Is this Python 2 or 3? Is this on Windows or a different platform? In an IDE or in a terminal (or Windows console)? – Martijn Pieters May 31 '15 at 21:03
-
Look at this http://stackoverflow.com/questions/10569438/how-to-print-unicode-character-in-python – user3282276 May 31 '15 at 21:06
-
possible duplicate of [How to display special characters in Python with print](http://stackoverflow.com/questions/15102222/how-to-display-special-characters-in-python-with-print) – Nic May 31 '15 at 21:07
1 Answers
1
You can print any unicode symbol by using the \uxxxx notation. For instance, 2588 is a code for unicode block.
print('\u2588')

Forketyfork
- 7,416
- 1
- 26
- 33
-
Oddly enough, that only works for me in Python 3, and it looks like the OP is using Python 2. – TigerhawkT3 May 31 '15 at 21:09
-
There is **way** too little context in the question to even begin to answer it. – Martijn Pieters May 31 '15 at 21:12