SHARE
TWEET

Untitled

a guest Mar 24th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top