I've been doing python programming for a few months and I have some code that needs a GUI. All the code does is various print outs to the screen, now in my head this sounds simple enough to convert to a GUI but I can't figure out where my actual code goes!
I have my frame with a txtctrl , all I need to do is .SetValue instead of print in my code I think but where does my existing code fit into the GUI code?
my frame is :
#!/usr/bin/python import wx class MyFrame(wx.Frame): def __init__(self, parent, title): wx.Frame.__init__(self, parent, title=title, size=(200,100)) self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE) self.Show(True) app = wx.App(False) frame = MyFrame(None, 'Example') app.MainLoop()
my existing code is:
#!/usr/bin/python printthis = 0 while 1: printthis+= 1 print printthis
How would I put the 2 together?
(OS: Linux, GUI kit: WxPython, Python Version: 2.6)