In [ ]:
from __future__ import print_function
from jsobject import JSObject
window = JSObject()
Print to the Javascript console from Python
In [ ]:
console = window.console
console.log('Hello from Python to Javascript')
Replace Javascript's console.log
with Python's print
In [ ]:
console.log = print
console.log('Hello from Python to Javascript to Python!')
Use Javascript to print to Python
In [ ]:
%%javascript
console.log('Hello from Javascript to Python');