Hi, all
from multiprocessing import Process
import wx
class MainWindow(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, title="sylphlker")
self.Center()
self.panel = wx.Panel(self, wx.ID_ANY)
self.k1 = wx.TextCtrl(self.panel, -1, "F1", size=(45,25), style=wx.TE_READONLY)
def HotKey():
hotkey=MainWindow()
hotkey = hotkey.k1.GetValue()
print(hotkey)
if __name__ == '__main__':
app = wx.App()
frame = MainWindow()
frame.Show()
app.MainLoop()
p = Process(target = HotKey)
p.start()
Why don’t threads execute concurrently with GUI?, An error is thrown when the GUI is closed:wx._core.PyNoAppError: The wx.App object must be created first!