Created
September 14, 2015 02:26
-
-
Save phoemur/5c9e6143559fabc89caa to your computer and use it in GitHub Desktop.
Try to replicate Metasploit Framework init bar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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