Skip to content

Instantly share code, notes, and snippets.

@jbn
Created April 18, 2018 13:36
Show Gist options
  • Save jbn/6b87f180cff5dae4b6554ef58ba26c6f to your computer and use it in GitHub Desktop.
Save jbn/6b87f180cff5dae4b6554ef58ba26c6f to your computer and use it in GitHub Desktop.
import sys, locale
exprs = """
locale.getpreferredencoding()
type(fp)
fp.encoding
sys.stdout.isatty()
sys.stdout.encoding
sys.stdin.isatty()
sys.stdin.encoding
sys.stderr.isatty()
sys.stderr.encoding
sys.getdefaultencoding()
sys.getfilesystemencoding()
"""
with open("./YOUR_NOTEBOOK_FILE.ipynb", "r") as fp:
for expr in exprs.strip().split():
print(expr.rjust(30), eval(expr))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment