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()
def GetText(): def thread_proc(): global clipboardcontents clipboardcontents = System.Windows.Forms.Clipboard.GetText() t = Thread(ThreadStart(thread_proc)) t.ApartmentState = System.Threading.ApartmentState.STA t.Start() t.Join()
def startInteractive(): global are are = AutoResetEvent(False) t = Thread(ThreadStart(appStart)) t.ApartmentState = ApartmentState.STA t.Start() are.WaitOne() IronPython.Hosting.PythonEngine.ConsoleCommandDispatcher = DispatchConsoleCommand
def EnableDrop(): def thread_proc(): form = DragDrop(IN[2]) form.add_range(l1_arr) Application.Run(form) global out1 out1 = form.output1 Application.Exit() t1 = Thread(ThreadStart(thread_proc)) t1.ApartmentState = System.Threading.ApartmentState.STA t1.Start() t1.Join()