Skip to content

Instantly share code, notes, and snippets.

@phoemur
Created September 14, 2015 02:26
Show Gist options
  • Save phoemur/5c9e6143559fabc89caa to your computer and use it in GitHub Desktop.
Save phoemur/5c9e6143559fabc89caa to your computer and use it in GitHub Desktop.
Try to replicate Metasploit Framework init bar
#!/usr/bin/env python
import sys
import time
from itertools import cycle
MESSAGE = ' [*] Starting Metasploit Framework Console...'
CYCLES = ['-', '\\', '|', '/']
for index in cycle(range(len(MESSAGE))):
for c in CYCLES:
if not MESSAGE[index].isalpha():
continue
buff = list(MESSAGE)
buff.append(c)
buff[index] = buff[index].swapcase()
sys.stdout.write(''.join(buff))
time.sleep(0.1)
sys.stdout.write('\r')
sys.stdout.flush()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment