python - Difference between wx.TextCtrl .write / .WriteText / .AppendText -
I am new to Python and therefore I'm new to wxPython too. I was just thinking that there is a difference in these wx.TextCtrl functions. This mini code shows three times the same output. If there is no difference then is there any historical reason for these actions?
import wx class testUI (wx.Panel): textCtrl = 'def __init __ (self, guardian, name): super (TestUI, self) .__ init __ (parent, name = Name) self.Show (True) self.textCtrl.write ('bli \ n') self.textCtrl.WriteText ('bla \ n') itself .textCtrl.AppendText ('blub \ n') def buildUI (self): self.textCtrl = wx.TextCtrl (self style = wx.TE_MULTILINE | wx.TE_READONLY) box = wx.boxSizer (wx.VERTICAL) Bokskjoden (Self.textCtrl, ratio = 1, the flag = Wx.EXPAND) Def main (): AP = wx.App (wrong) root = wx.Frame (original = none, title = 'testUI') testUI (parent = root, name = 'testUI') root.Show ( True) app.MainLoop () # Standard boilerplate for calling the main function If __name__ == '__main__': main () thanks > 3 ways are functionally the same, however, I argue that you will use appendex
to add additional text in the text, so you can make yourself very clear in code . Most of the time, you will usually use SetValue
I've redirected stdout using WriteText
, but that's it. You can read about the use case here:
-
Comments
Post a Comment