Skip to content

Instantly share code, notes, and snippets.

@abhi923
Created April 18, 2020 13:54
Show Gist options
  • Save abhi923/7f9d9aa5f2291dc0c06ac08ca68d41c9 to your computer and use it in GitHub Desktop.
Save abhi923/7f9d9aa5f2291dc0c06ac08ca68d41c9 to your computer and use it in GitHub Desktop.
import time, sys
indent = 0 # How many spaces to indent.
indentIncreasing = True # Whether the indentation is increasing or not.
try:
while True: # The main program loop.
print(' ' * indent, end='')
print('* ******** *')
time.sleep(0.1) # Pause for 1/10 of a second.
if indentIncreasing:
# Increase the number of spaces:
indent = indent + 1
if indent == 40:
# Change direction:
indentIncreasing = False
else:
# Decrease the number of spaces:
indent = indent - 5
if indent == 5:
# Change direction:
indentIncreasing = True
except KeyboardInterrupt:
sys.exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment