forked from ankitsejwal/Lyndor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage.py
More file actions
executable file
·64 lines (50 loc) · 1.69 KB
/
Copy pathmessage.py
File metadata and controls
executable file
·64 lines (50 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env python
# -*- coding: utf-8 -*-
''' All printing messages and functions '''
import time
import sys
from colorama import *
ENTER_URL = " 🚀 Paste the url of a Lynda course >>> "
NETSCAPE = '# Netscape HTTP Cookie File\n'
RENAMING_ERROR = "\nError in renaming file !!!"
INFO_FILE_CREATED = "\n🌟 info.txt created\n"
def animate_characters(color, string, speed):
'''printing ASCII arts line by line'''
for line in string.splitlines():
print(color + line + Fore.RESET)
time.sleep(speed)
def spinning_cursor():
'''spinning cursor'''
flag = True
while flag:
for cursor in '\\|/- ':
time.sleep(0.2)
# Use '\r' to move cursor back to line beginning
# Or use '\b' to erase the last character
sys.stdout.write('\r{}'.format(cursor))
# Force Python to write data into terminal.
sys.stdout.flush()
flag = False
def write(description, value):
'''prints out any message'''
sys.stdout.write(str(description) + '\t' + str(value) + '\n')
sys.stdout.flush()
def print_line(value):
''' prints out any string '''
sys.stdout.write(str(value) + '\n')
sys.stdout.flush()
def colored_message(color, message):
''' print colored line '''
print(color + message + Fore.RESET)
def return_colored_message(color, message):
''' return colored line '''
return color + message + Fore.RESET
def carriage_return_animate(line):
''' print running line over an existing line '''
for char in line:
sys.stdout.write(char)
time.sleep(0.02)
sys.stdout.flush()
sys.stdout.write('\r')
time.sleep(0.4)
sys.stdout.write("\033[K")