Archive
Unicode box-drawing characters
I wanted to make a logo for my project PrimCom. Since it runs in the command line, I wanted to draw the logo with characters.
You can find a list of box-drawing characters here. I designed the logo on a paper, translated the box characters to normal characters (this way it was easier to type them in), then translated the characters back with a script.
Python source:
#!/usr/bin/env python
# encoding: utf-8
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import sys
chars = {
'a': '┌',
'b': '┐',
'c': '┘',
'd': '└',
'e': '─',
'f': '│',
'g': '┴',
'h': '├',
'i': '┬',
'j': '┤',
'k': '╷',
'l': '┼',
}
logo = """
aeeb aeeb
fabf faec
fdcheiieejf aeeieeb
faejaljkkff fabfkkf
ff fffffffdejdcffff
dc dcdggggeegeegggc
"""
def main():
for c in logo:
if c in chars:
sys.stdout.write(chars[c])
else:
sys.stdout.write(c)
if __name__ == "__main__":
main()
Output:
┌─────┐ ┌─────┐ │ ┌─┐ │ │ ┌───┘ │ └─┘ ├───┬─┬─────┤ │ ┌─────┬─────┐ │ ┌───┤ ┌─┼─┤ ╷ ╷ │ │ │ ┌─┐ │ ╷ ╷ │ │ │ │ │ │ │ │ │ │ └───┤ └─┘ │ │ │ │ └─┘ └─┘ └─┴─┴─┴─┴─────┴─────┴─┴─┴─┘
Update (20140322)
If you want rainbow colors, check out the colout project.
Python vs Java in relation to logos
Emanuel Couto explains the difference between Python and Java, comparing the logos of the two languages:
“I read almost all comments and I there is one point that all of you missed! The logo is important for productivity!
The Python logo is obviously a snake. The name of the language, however, was based on Monty Python. So what this means is that you are going to have good laughs when the python bytes you. Specially when the code is too long to debug or understand.
The Java logo is a cup of coffee. What this means is that you are going to need coffee when programming in Java or you will fall asleep. In fact you are going to need loads of coffee when your code is near production stage. BTW I don’t drink coffee, so my job is twice as hard.
Jython is when you give coffee to a snake. Jython users are people that drank toomuch coffee and over time it doesn’t have any effect anymore. Since the python needs to sleep, the solution is giving coffee so that Java programmers can also have laughs at late hours of the day.
And that folks is a true story.” (source)
