gpt4 book ai didi

python 木星 : Shortcut to copy output of a cell

转载 作者:太空狗 更新时间:2023-10-29 20:27:07 25 4
gpt4 key购买 nike

请参阅随附的屏幕截图:enter image description here

在 Jupyter Python 中:是否有将单元格的输出复制到剪贴板的快捷方式? (即无需手动选择和 ctrl-c?)

或者是否有一个 python 函数可以代替 print 将其输出直接返回到剪贴板以便稍后粘贴?

最佳答案

您可以使用以下代码:

import pandas as pd
df = pd.DataFrame(['Copy me to clipboard'])
df.to_clipboard(index=False,header=False)

关于 python 木星 : Shortcut to copy output of a cell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41497432/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com