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.
我想在 Python 终端中捕获 IPython 终端产生的输出。因为所有测试都是使用 Python 内核进行的。我知道 IPython 魔术函数。%%capture 有没有办法将这些魔术函数用作上下文管理器并捕获输出,或者其他方式?
谢谢。