Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from colorama import init
- from sys import stdout
- init()
- def write(type: str, message: str) -> None:
- if stdout.writelines is False:
- return
- if type.lower() == 'info':
- stdout.write(
- '({GREEN}Info{RESET}): {MESSAGE}'.format(
- GREEN='\x1b[32m',
- RESET='\x1b[0m',
- MESSAGE=message
- )
- )
- elif type.lower() == 'error':
- stdout.write(
- '({RED}Error{RESET}): {MESSAGE}'.format(
- RED='\x1b[31m',
- RESET='\x1b[0m',
- MESSAGE=message
- )
- )
- else:
- return
- def writeline(type: str, message: str) -> None:
- write(type, '{}\n'.format(message))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement