I have been looking through the previous posts - but with my lack of
knowledge on the whole tkinter subject - I have no clue what to look
for ...
SO - can anyone please help with this ...?
I have a python server that when it gets a connection from a client -
it sends data back - quite a bit of it - in discreet parts - around
1024 byte chunks ...
I have created a tkinter client that makes a simple connect to the
server. What I have a problem with is I need the client to write all
the data to the Text() widget created in the GUI client - the Text()
widget is created as :
self.text=Text( self.center_fra me,background=' white')
scroll=Scrollba r(self.center_f rame)
self.text.confi gure(yscrollcom mand=scroll.set )
self.text.pack( side=LEFT, fill=BOTH, expand=YES)
scroll.pack(sid e=RIGHT,fill=Y)
self.center_fra me.pack(side=RI GHT, expand=YES, fill=BOTH)
I have a button with "Connect" written on it that connects to the
server by calling :
HOST = 'localhost'
PORT = 9000
global s
for res in socket.getaddri nfo(HOST, PORT, socket.AF_UNSPE C,
socket.SOCK_STR EAM):
af, socktype, proto, canonname, sa = res
try:
s = socket.socket(a f, socktype, proto)
except socket.error, msg:
s = None
continue
try:
s.connect(sa)
except socket.error, msg:
s.close()
s = None
continue
break
if s is None:
print 'could not open socket'
self.quitButton Click
NOW - HOW do I get the server's sent data to continuiosly print in the
Text() widget ?
Many thank
Tonino
knowledge on the whole tkinter subject - I have no clue what to look
for ...
SO - can anyone please help with this ...?
I have a python server that when it gets a connection from a client -
it sends data back - quite a bit of it - in discreet parts - around
1024 byte chunks ...
I have created a tkinter client that makes a simple connect to the
server. What I have a problem with is I need the client to write all
the data to the Text() widget created in the GUI client - the Text()
widget is created as :
self.text=Text( self.center_fra me,background=' white')
scroll=Scrollba r(self.center_f rame)
self.text.confi gure(yscrollcom mand=scroll.set )
self.text.pack( side=LEFT, fill=BOTH, expand=YES)
scroll.pack(sid e=RIGHT,fill=Y)
self.center_fra me.pack(side=RI GHT, expand=YES, fill=BOTH)
I have a button with "Connect" written on it that connects to the
server by calling :
HOST = 'localhost'
PORT = 9000
global s
for res in socket.getaddri nfo(HOST, PORT, socket.AF_UNSPE C,
socket.SOCK_STR EAM):
af, socktype, proto, canonname, sa = res
try:
s = socket.socket(a f, socktype, proto)
except socket.error, msg:
s = None
continue
try:
s.connect(sa)
except socket.error, msg:
s.close()
s = None
continue
break
if s is None:
print 'could not open socket'
self.quitButton Click
NOW - HOW do I get the server's sent data to continuiosly print in the
Text() widget ?
Many thank
Tonino
Comment