1

I know that we can print out symbols and convert decimal/octal/hex from the ascii table, but I wanted to create a cute border around text without doing something boring like

...................................
| BORING BORDER                   |
...................................

I'd rather have something cute like the text borders found here: http://cutekaomoji.com/misc/sparkles/

I've tried to copy and paste a few of these, but I typically just see the placeholder box or the program wont compile.

print("。☆✼★━━━━━━━━━━━━★✼☆。")

Is there something I can do to use a certain font, or some other reference sheet for special characters that I should know about?

6
  • Tested locally: nothing wrong. Commented Feb 23, 2018 at 4:33
  • Yes, you can print Unicode characters to your terminal if your terminal supports it. But Python 2 assumes ASCII source code unless configured so you normally have to use escape codes instead: u'\uff61\u2606\u273c\u2605\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2605\u273c\u2606\uff61' Commented Feb 23, 2018 at 4:34
  • Works for me with python 2 and 3 on mac/linux. Does putting a u in front help like print(u'(╯°□°)╯︵ ┻━┻)')? Commented Feb 23, 2018 at 4:34
  • i suppose you are doing it in python3, i tested it and it works fine. Commented Feb 23, 2018 at 4:36
  • The error I'm seeing is: "Some characters cannot be mapped using "Cp1252" character encoding. Either change the encoding or remove the characters which are not supported by the "Cp1252" character encoding." None of the suggestions are working. I'm using the Eclipse IDE with PyDev. Commented Feb 23, 2018 at 4:39

4 Answers 4

3

An even better solution is: Use Python 3.

It's a encoding problem, special characters are only include in utf-8, utf-16... And Python 3 works by default with utf-8 (reference).

Sign up to request clarification or add additional context in comments.

Comments

1

try adding encoding on top of your script and it should work.

Ex:

# -*- coding: utf-8 -*-
print("。☆✼★━━━━━━━━━━━━★✼☆。")

Comments

0

Each comment helped me better understand what was wrong, and learn more about using PyDev, so I really appreciate the help.

The solution that worked was from Rakesh

# -*- coding: utf-8 -*-
print("。☆✼★━━━━━━━━━━━━★✼☆。")

Comments

0

print("Add your Unicode char"); will work. Unicode is understood by the output statement.

You can use https://www.myweirdtext.com/ to generate the Unicode char and paste it inside the print statement.

Ex:

  print("—(••÷[---------------]÷••)—");

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.