icecream
icecream copied to clipboard
Added env variable way to output to stdout and autocheck for Jupyter
Basically, icecream will now automatically output to stdout if any of the following is true:
- The environment variable
PYTHON_ICECREAM_USE_STDOUT
evaluates to true. - The code is running from inside Jupyter.
thank you for this PR!
why use stdout over stderr inside jupyter?
Because stderr shows in a different background color that makes it look like an error or warning.
On Sun, 9 Jan 2022 at 00:59, Ansgar Grunseid @.***> wrote:
thank you for this PR!
why use stdout over stderr inside jupyter?
— Reply to this email directly, view it on GitHub https://github.com/gruns/icecream/pull/112#issuecomment-1008224915, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXIYHEPUI2GCEJXQGDLM43UVEB3PANCNFSM5KKS7M7Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
Related discussion: https://github.com/gruns/icecream/issues/77#issuecomment-994217945
@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: https://github.com/gruns/icecream/issues/100#issuecomment-896250411
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.