craigbarratt / hass-pyscript-jupyter

Jupyter kernel shim to connect to HASS pyscript
Apache License 2.0
60 stars 10 forks source link

print doesn't work #9

Closed basnijholt closed 4 years ago

basnijholt commented 4 years ago

When writing scripts in a Jupyter notebook it is often useful to print something. Unfortunately, print doesn't work.

Is this intended?

craigbarratt commented 4 years ago

A couple of days ago I added print as an alias for log.debug, which was needed by the black and isort nbextensions. The output from print should appear in Jupyter and, if debug is turned on, it will also appear in the HASS log.

However, it only takes a single argument and no keywords (like file). The reason I removed the original function is that there isn't really a stdout available, and I didn't want I/O available to arbitrary file descriptors.

It would be easy to make it work with multiple arguments (the log.xxx() functions should do the same).