ascii-art

Output ASCII art to console on succesfull pytest run

杀马特。学长 韩版系。学妹 提交于 2019-12-02 00:07:31
I'm using pytest to run tests in Django project. I'm using pytest.ini where DJANGO_SETTINGS_MODULE is defined, so I run tests with just: pytest Now, I want to add some ASCII art to the console output if the test run is successful. I know I can do: pytest && cat ascii_art.txt But I want to hide the ASCII art to config or somewhere else so that I keep running tests with just pytest . I don't see any pytest config option I can use. Any other ideas how this could be done? There are lots of places where you can print your own stuff in pytest ; select an appropriate hook from the hooks list and

Making diamond ASCII art with Python

这一生的挚爱 提交于 2019-12-01 07:54:16
I'm having trouble making this diamond. Whenever I make chars equal to an even length, it turns out fine. However, when it is odd, only the bottom portion of the diamond gets messed up. I've been working hours on this and am almost done. Thanks in advance for the help. chars = 'ABCDEF' length = len(chars) string = '' dots = (length*2 - 1)*2 - 1 for i in range(length): string1 = '' string += chars[i] length1 = len(string) for j in range(0, length1): if j % 2 != 0: string1 += chars[length -1 - j].center(3, '.') else: string1 += chars[length - 1 - j] for k in range(i - 1, -1, -1): if k % 2 != 0:

Making diamond ASCII art with Python

断了今生、忘了曾经 提交于 2019-12-01 05:32:25
问题 I'm having trouble making this diamond. Whenever I make chars equal to an even length, it turns out fine. However, when it is odd, only the bottom portion of the diamond gets messed up. I've been working hours on this and am almost done. Thanks in advance for the help. chars = 'ABCDEF' length = len(chars) string = '' dots = (length*2 - 1)*2 - 1 for i in range(length): string1 = '' string += chars[i] length1 = len(string) for j in range(0, length1): if j % 2 != 0: string1 += chars[length -1 -

Is there an equivalence table to convert ASCII smileys to Unicode emoji(s)?

冷暖自知 提交于 2019-12-01 05:10:16
I would like to find a table to convert the old school western ascii emoticons :-) into their modern unicode equivalent ☺. Do you know if there is one? Not everyone agrees on what is what, but here is one such possible table mapping input ASCII-art emoticons to Unicode emoji. Both data elements are single quoted, so backslashes and single quotes are escaped. 'o/' => '👋', '</3' => '💔', '<3' => '💗', '8-D' => '😁', '8D' => '😁', ':-D' => '😁', '=-3' => '😁', '=-D' => '😁', '=3' => '😁', '=D' => '😁', 'B^D' => '😁', 'X-D' => '😁', 'XD' => '😁', 'x-D' => '😁', 'xD' => '😁', ':\')' => '😂', ':\'-)' => '😂', ':-))

Is there an equivalence table to convert ASCII smileys to Unicode emoji(s)?

痴心易碎 提交于 2019-12-01 02:51:19
问题 I would like to find a table to convert the old school western ascii emoticons :-) into their modern unicode equivalent ☺. Do you know if there is one? 回答1: Not everyone agrees on what is what, but here is one such possible table mapping input ASCII-art emoticons to Unicode emoji. Both data elements are single quoted, so backslashes and single quotes are escaped. 'o/' => '👋', '</3' => '💔', '<3' => '💗', '8-D' => '😁', '8D' => '😁', ':-D' => '😁', '=-3' => '😁', '=-D' => '😁', '=3' => '😁', '=D' =>

ASCII table where field can have newlines

自闭症网瘾萝莉.ら 提交于 2019-12-01 01:33:59
I have following function that display ASCII table function ascii_table(array, header) { if (!array.length) { return ''; } var lengths = array[0].map(function(_, i) { var col = array.map(function(row) { if (row[i] != undefined) { return row[i].length; } else { return 0; } }); return Math.max.apply(Math, col); }); array = array.map(function(row) { return '| ' + row.map(function(item, i) { var size = item.length; if (size < lengths[i]) { item += new Array(lengths[i]-size+1).join(' '); } return item; }).join(' | ') + ' |'; }); var sep = '+' + lengths.map(function(length) { return new Array(length

ASCII table where field can have newlines

天涯浪子 提交于 2019-11-30 20:09:42
问题 I have following function that display ASCII table function ascii_table(array, header) { if (!array.length) { return ''; } var lengths = array[0].map(function(_, i) { var col = array.map(function(row) { if (row[i] != undefined) { return row[i].length; } else { return 0; } }); return Math.max.apply(Math, col); }); array = array.map(function(row) { return '| ' + row.map(function(item, i) { var size = item.length; if (size < lengths[i]) { item += new Array(lengths[i]-size+1).join(' '); } return

How to create ASCII animation in a console application using Python 3.x?

社会主义新天地 提交于 2019-11-30 05:44:24
I would like to port this question to Python (Windows + Linux + Mac Os) How to create ASCII animation in Windows Console application using C#? Thank you! Philip Daubmeier I just ported my example with the animated gif to ASCII animation from my answer here to python. You will need to install the pyglet library from here , as python unfortunately has no built-in animated-gif support. Hope you like it :) import pyglet, sys, os, time def animgif_to_ASCII_animation(animated_gif_path): # map greyscale to characters chars = ('#', '#', '@', '%', '=', '+', '*', ':', '-', '.', ' ') clear_console =

Ascii Art - Java [closed]

烈酒焚心 提交于 2019-11-29 22:39:36
I want to make a program, where the user enters their name and the program generates an ascii picture of their name. Is it possible to do that without using 3rd party tools? What I came up with was to create each letter in the alphabet manually and then convert the string into a char array. Then return each image that corresponds with the letter. Is there a better or more efficent way of doing this? Thanks. You can write text to a bitmap in any font you want and scan the bitmap to produce the ASCII art. You can even use anti-aliasing for effect. ;) The last time I did this was about tens years

Horizontally and vertically center a pre tag without the use of tables?

二次信任 提交于 2019-11-29 12:48:26
Is it possible to horizontally and vertically align a pre tag without tables? I want to vertically and horizontally align some ASCII art on a webpage. While I have already produced a successful adaption using tables , I want to know if its possible to convert it to using other elements and CSS. Every piece of ASCII art is a different height and width, so therefore it is important to note that the solution to my issue must involve not having a fixed height or width requirement. Thank you. Throw er in a div and center that div one of these ways http://tutorialzine.com/2010/03/centering-div