📜  复制到剪贴板 python 代码示例

📅  最后修改于: 2022-03-11 14:47:10.731000             🧑  作者: Mango

代码示例4
import clr
import System
from System.Threading import Thread, ThreadStart
clr.AddReference("System.Windows.Forms")

def SetText(text):
    def thread_proc():
        System.Windows.Forms.Clipboard.SetText(text)
    t = Thread(ThreadStart(thread_proc))
    t.ApartmentState = System.Threading.ApartmentState.STA
    t.Start()
SetText("Hello word")