Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. # Example output:
  2. # .-'¯ _,.-'¯ _,.-'¯ _,.-'¯ _,.-'¯ | your message here |.,_ ¯'-.,_ ¯'-.,_ ¯'-.,_ ¯'-.,_ ¯
  3. # The things next to the message are animated and moving.
  4.  
  5. import time
  6. import sys
  7. import os
  8.  
  9.  
  10. def wait():
  11. _, cols = os.popen('stty size', 'r').read().split()
  12. cols = int(cols)
  13.  
  14. # You can choose or create a different animation pattern:
  15. # chars = "_.~\"|"
  16. # chars = "\"`-._,-'"
  17. # chars = """|/-.-\\|/-'-\\"""
  18. # chars = """|/-\\|/-\\"""
  19. chars = "_,.-'¯ "
  20.  
  21. message = "| your message here |"
  22. cols -= len(message)
  23. half_cols = int(cols/2)
  24.  
  25. for i in range(100000):
  26. time.sleep(0.07)
  27. sys.stdout.write("\r" +
  28. "".join([chars[(i + j) % len(chars)] for j in range(half_cols)]) +
  29. message +
  30. "".join([chars[(i - j) % len(chars)] for j in range(half_cols)])
  31. )
  32. sys.stdout.flush()
  33. # print("") # uncomment this line to print many lines, filling up the whole screen.
  34.  
  35.  
  36. wait()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement