Twill causing print() not to show

113 Views Asked by At

I'm trying to use Twill with Jupyter/Python. However if I use Print() after I've imported Twill eg.

from twill.commands import go, showforms, formclear, fv, submit, show

print("hi") 

it won't print anything.

Is this normal behaviour?

This happens on google colan and jupyterLab

1

There are 1 best solutions below

0
Synthaze On

It is possible that your module has its own sys module which makes troubles with Jupyter upon import.

Try this:

from twill.commands import go, showforms, formclear, fv, submit, show
import sys

sys.stdout = stdout

print ('hi')

Otherwise I'd just recommend never using those online notebooks which are, to my opinion, essentially limiting because of unexpected behaviors not easy to solve due to a lack of documentation relative to main Python.