Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added env variable way to output to stdout and autocheck for Jupyter #112

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gjvnq
Copy link

@gjvnq gjvnq commented Dec 18, 2021

Basically, icecream will now automatically output to stdout if any of the following is true:

  1. The environment variable PYTHON_ICECREAM_USE_STDOUT evaluates to true.
  2. The code is running from inside Jupyter.

@gruns
Copy link
Owner

gruns commented Jan 9, 2022

thank you for this PR!

why use stdout over stderr inside jupyter?

@gjvnq
Copy link
Author

gjvnq commented Jan 9, 2022 via email

@alexmojaki
Copy link
Collaborator

Related discussion: #77 (comment)

@gjvnq Why not use the isnotebook you put there? IPython is a lot more general than Jupyter notebooks.

Another way to detect Jupyter is described here: #100 (comment)

Apparently disabling colorama in Jupyter would be good too.

On another note, PYTHON_ICECREAM_USE_STDOUT is very wordy for a library all about convenience. IC_STDOUT seems sufficiently unique.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants