here2share

# b_fun_text_art.py

Aug 3rd, 2020 (edited)
903
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.45 KB | None | 0 0
  1. # b_fun_text_art.py
  2.  
  3. py = '''\
  4. #### #   # ##### #   #  ###  #    #
  5. #   # # #    #   #   # #   # ##   #
  6. #   #  #     #   ##### #   # # #  #
  7. ####   #     #   #   # #   # #  # #
  8. #      #     #   #   # #   # #   ##
  9. #      #     #   #   #  ###  #    #
  10. '''
  11.  
  12. ttt = py.replace('#', '_/').replace(' ', '  ').splitlines()
  13. print '\n'.join(ttt)
  14. print
  15.  
  16. banner = ''
  17. for i, s in enumerate(ttt):
  18.     banner += (' '*(len(ttt)-i)+s)+'\n'
  19. print banner
  20.  
  21. a,b = ('(((','()')
  22. ttt = py.replace('#', a).replace(' ', '   ').replace('( ', b).splitlines()
  23. banner = ''
  24. for i, l in enumerate(ttt):
  25.     banner += (' '*(len(ttt)-i)*2+l)[3:-1]+'\n'
  26. print banner
  27.  
  28. ttt = py.replace(' ', '__').replace('#', '$$').replace('__$', '| $').splitlines()
  29. for i in range(len(ttt)-1,0,-1):
  30.     sss = ''
  31.     for j, s in enumerate(ttt[i]):
  32.         t = ttt[i-1]
  33.         if s == '|' and t[j] != '|':
  34.             sss += '*'
  35.         else:
  36.             sss += s
  37.     ttt[i] = sss
  38.  
  39. sss = ''
  40. ttt.append('')
  41. i = -1
  42. for j, s in enumerate(ttt[i-1]):
  43.     if s == '|':
  44.         sss += ':'
  45.     elif (ttt[i-1]+'--')[j+2] in '$.':
  46.         sss += ' '
  47.     else:
  48.         sss += '_'
  49. L = len(max(ttt, key=len))
  50. ttt[i] = sss
  51. ttt = ['__'+(z+' '*20+'_'*5)[:L+2] for z in ttt]
  52. ttt[i] = ttt[i].replace(' _', '  ')
  53. ttt[i] = ttt[i].replace('_ ', '__')
  54. ttt[i] = ttt[i][:-2]
  55.  
  56. ttt[0] = ttt[0].replace('|', ' ')
  57.  
  58. ttt = '\n'.join(ttt)
  59. ttt = ttt.replace('._', '_.')
  60. ttt = ttt.replace('*', ' ')
  61. ttt = ttt.replace('_$', '_$')
  62. ttt = ttt.replace('__\n', '\n')
  63. print ttt
Add Comment
Please, Sign In to add comment