about python scripting
Posted
by kmitnick
on Stack Overflow
See other posts from Stack Overflow
or by kmitnick
Published on 2010-04-29T23:39:59Z
Indexed on
2010/04/29
23:47 UTC
Read the original article
Hit count: 323
I have this code
class HNCS (ThreadingTCPServer):
def verify_request(self, request, client_address):
for key in connections:
if connections[key].client_address[0] == client_address[0]:
if client_address[0] != '127.0.0.1':
return False
return True
def welcome(self):
return '''______________________________________________________
------------------------------------------------------
%s
______________________________________________________
------------------------------------------------------
* Server started %s
* Waiting for connections on port %i
''' % (gpl, ctime(), PORT)
I only can't figure out the line where it says if connections[key].client_address[0] == client_address[0]
how come we used client_address as an attribute after dictionary???
© Stack Overflow or respective owner