Skip to content

Instantly share code, notes, and snippets.

@Kalimaha
Created June 17, 2017 00:13
Show Gist options
  • Select an option

  • Save Kalimaha/e0ea8eab822bfca30ff36ab5bcfd51ca to your computer and use it in GitHub Desktop.

Select an option

Save Kalimaha/e0ea8eab822bfca30ff36ab5bcfd51ca to your computer and use it in GitHub Desktop.
Print to terminal in colours w/ Python
print('\033[95m' + '[ ] - ' + s.state + '\033[0m')
print('\033[92m' + '[✓] - ' + s.state + '\033[0m')
print('\033[93m' + '[!] - ' + s.state + '\033[0m')
print('\033[91m' + '=======================\033[0m')
print('\033[91m' + '[x] - ' + s.state + '\033[0m')
print('\033[91m' + '-----------------------\033[0m')
print('\033[91m' + 'Expected:\n\n ' + str({'spam': 'eggs'}) + '\n\nActual:\n\n ' + str({'eggs': 'bacon'}) + '\033[0m')
print('\033[91m' + '=======================\033[0m')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment