Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将斜纹与 Jupyter/Python 一起使用。但是,如果我在导入斜纹之后使用 Print(),例如。
from twill.commands import go, showforms, formclear, fv, submit, show print("hi")
它不会打印任何东西。
这是正常行为吗?
这发生在 google colan 和 jupyterLab
您的模块可能有自己的sys模块,这在导入时会导致 Jupyter 出现问题。
sys
尝试这个:
from twill.commands import go, showforms, formclear, fv, submit, show import sys sys.stdout = stdout print ('hi')
否则,我只是建议永远不要使用那些在线笔记本,在我看来,这些笔记本本质上是有限的,因为由于缺乏与主要 Python 相关的文档,难以解决意外行为。