【问题标题】:how to paste in a txt in python如何在python中粘贴txt
【发布时间】:2021-06-21 00:35:47
【问题描述】:

我正在尝试粘贴一个 txt 块,但无论我多么努力,我总是收到错误

复制部分已解决,但尚未粘贴到 txt 中

import pyperclip

with open('conta.txt', 'w+') as f:
    conteudo = f.write()
    pyperclip.paste(str(conteudo))

【问题讨论】:

    标签: python pyperclip


    【解决方案1】:

    认为它更像是这样的:

    import pyperclip
    
    with open('conta.txt', 'w+') as f:
        f.write( pyperclip.paste() )
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-30
      • 1970-01-01
      • 2022-11-11
      • 2021-08-01
      • 2017-12-23
      相关资源
      最近更新 更多