Advertisement
Waternode

ASCii Artist

Aug 27th, 2012
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. ASCii Artists
  2.  
  3. They Program Things In Python as text art.
  4.  
  5. For example:
  6.  
  7. print('''
  8. _____
  9. |{} {}|
  10. | Z |
  11. | === |
  12. -------
  13. ''')
  14. Face ^
  15.  
  16. Also you can add colors like so:
  17. (code)
  18. # change color in the python.exe console display (Windows)
  19. # color is a two digit hexadecimal number
  20. # the first digit is the background
  21. # the second digit is the foreground (text)
  22. # 0=black 1=blue 2=green ... to E=yellow F=white
  23. import os
  24. os.system("color F2") # green(2) text on white(F) background
  25. (code)
  26. NOTE: This method of colors are only known to work on Windows
  27. Further color codes here: http://wiki.vg/File:Colors.png
  28.  
  29. Also, they can make animations.
  30. How? You say.
  31. (code)
  32. import time
  33. import os
  34.  
  35. def cls():
  36. os.system(['clear','cls'][os.name == 'nt'])
  37. # Also is very useful for other things, it clears the console screen in windows for Python.
  38. # Note: I believe this might be Windows only as well, if it doesn't work, please Google the Mac & Linux ver.
  39.  
  40. print('O')
  41. time.sleep(0.125)
  42. # 8 Frames Per Second, because 1 = a seconds, and .125*8 = 1
  43. cls()
  44. # Clears the screen, as defined above.
  45. print(' o')
  46. time.sleep(0.125)
  47. cls()
  48. print(' O')
  49. time.sleep(0.125)
  50. cls()
  51. print(' o')
  52. time.sleep(0.125)
  53. cls()
  54. print(' O')
  55. time.sleep(0.125)
  56. cls()
  57. print(' o')
  58. time.sleep(0.125)
  59. cls()
  60. print(' O')
  61. time.sleep(0.125)
  62. cls()
  63. print(' o')
  64. time.sleep(0.125)
  65. cls()
  66. print(' O')
  67. time.sleep(0.125)
  68. cls()
  69. print(' o')
  70. time.sleep(0.125)
  71. cls()
  72. print(' O')
  73. time.sleep(0.125)
  74. cls()
  75. print(' o')
  76. time.sleep(0.125)
  77. cls()
  78. print(' O')
  79. time.sleep(0.125)
  80. cls()
  81. print(' *')
  82. time.sleep(0.125)
  83. cls()
  84. print(' #')
  85. time.sleep(0.125)
  86. cls()
  87. print(' 0')
  88. time.sleep(0.125)
  89. cls()
  90. (code)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement