<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 1/26/2012 4:22 PM, Navneet wrote:
<blockquote cite="mid:4F216F9D.3060002@gmail.com" type="cite">
  <meta http-equiv="content-type"
 content="text/html; charset=ISO-8859-1">
Hi,<br>
  <br>
I am trying to create a chat program.(Programs are attached)<br>
Please find the code below, where I am having the problem.<br>
  <br>
  <font color="#3333ff">def run( self ):<br>
&nbsp;&nbsp;&nbsp; while 1:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print "Hello There !!!!"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print self.descriptors<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Await an event on a readable socket descriptor<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (sread, swrite, sexc) = select.select( self.descriptors,
[], [] )<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print sexc <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Iterate through the tagged read descriptors<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print sread<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print "Hello There 1 !!!!"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for sock in sread:</font><br>
  <br>
  <br>
For this I am getting the output as below:<br>
  <font color="#cc0000">bash-3.1$ python Server.py<br>
Enter the Port:...9009<br>
ChatServer started on port 9009<br>
Hello There !!!!<br>
[&lt;socket._socketobject object at 0x0000000002487660&gt;]</font><br>
  <br>
  <br>
But it is not printing the value of sread or "Hello There 1 !!!!!"<br>
  <br>
  <br>
  <br>
  <br>
  <br>
</blockquote>
<small><font face="Verdana">Hello All,<br>
<br>
One more thing I want to add here is, I am trying to create the GUI
based chat server.(Attached the programs.)<br>
The concept is something like this:<br>
I will start a server on a particular port and different Clients can
interact with each other using that (more like a chat room )<br>
Now I want to add the GUI part in a different module and want to call
that module from client program.<br>
But while executing the client1.py I am getting below error :<br>
<br>
<br>
<br>
</font><font color="#cc0000" face="Verdana">bash-3.1$ python Client1.py<br>
Enter the server address:...9009<br>
Traceback (most recent call last):<br>
&nbsp; File "Client1.py", line 53, in &lt;module&gt;<br>
&nbsp;&nbsp;&nbsp; c = ClientChat(serverport)<br>
&nbsp; File "Client1.py", line 24, in __init__<br>
&nbsp;&nbsp;&nbsp; gui.callGui()<br>
&nbsp; File "a:\FedEx\Exp\ClientGui.py", line 37, in callGui<br>
&nbsp;&nbsp;&nbsp; sendbutton =Button(f2, width = 5, height = 2, text = "Send",
command = C.ClientChat.senddata())<br>
TypeError: unbound method senddata() must be called with ClientChat
instance as first argument (got nothing instead)</font></small><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>