Skip to content

Instantly share code, notes, and snippets.

@iamsudip
Created April 10, 2015 19:56
Show Gist options
  • Save iamsudip/43e250d7b26f590c3d6c to your computer and use it in GitHub Desktop.
Save iamsudip/43e250d7b26f590c3d6c to your computer and use it in GitHub Desktop.
random gist
import codecs, locale, sys
encoding = sys.stdout.encoding or locale.getpreferredencoding()
encoder = codecs.getwriter(encoding)
sys.stdout = encoder(sys.stdout,'backslashreplace')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment