Hello I am building a simple python app to further educate myself.<br><br>I am almost some what complete with this application. However I can not think how to add more than one entry to a TextBox. So when I input the first value it stays and then the second value third and so forth right now it replaces the first value with the second etc etc<br>
<br>Here is my app code<br><br>#PYTHON#<br><br><br>import clr<br>clr.AddReference(&quot;PresentationFramework&quot;)<br>clr.AddReference(&quot;PresentationCore&quot;)<br><br>from System.IO import File<br>from System.Windows.Markup import XamlReader<br>
from System.Windows import *<br><br>import socket<br>from threading import *<br>import cPickle<br><br>CMD_MSG = range(1)<br><br>class Chat(object):<br>    def __init__(self):<br>      mythread = Thread(target=self.server)<br>
      mythread.start() <br>      stream = File.OpenRead(&quot;p2pChat.xaml&quot;)<br>      self.root = XamlReader.Load(stream)        <br>      self.ip_address_input = self.root.FindName(&#39;ip_address&#39;)          <br>
      self.sendB = self.root.FindName(&#39;send&#39;)<br>      self.output = self.root.FindName(&#39;textbox&#39;)<br>      self.entry_input = self.root.FindName(&#39;entry&#39;)<br>      self.sendB.Click += self.sendit<br>
<br>    def server(self):<br>      self.port = 9000<br>      self.s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)<br>      self.s.bind((socket.gethostbyname(socket.gethostname()), int(self.port)))<br>      #print socket.gethostbyname(socket.gethostname())<br>
      while True:<br>        msg, addr = self.s.recvfrom(2024)<br>##        cmd, msg = ord(msg[0]),msg[1:]<br>##        if cmd == CMD_MSG:<br>        self.output.Text = str(msg) + &quot;\n&quot;<br>                <br>    def client(self, msg):<br>
        self.port = 9000<br>        self.host = self.ip_address_input.Text<br>        <a href="http://self.se">self.se</a> = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)<br>        self.se.sendto(str(self.host) + &quot; : &quot; + msg, (self.host, int(self.port)))<br>
<br>    def sendit(self, s, e):<br>        self.client(str(self.entry_input.Text))<br>        self.output.Text = str(self.entry_input.Text + &quot;\n&quot;)<br>        self.entry_input.Text = &quot;&quot;<br><br><br><br>myChat = Chat()<br>
<br><br>app = Application()<br>app.Run(myChat.root)<br><br>Thanks in advance :-)<br><br><br>