![]() |
2010-02-15
, 16:07
|
Posts: 19 |
Thanked: 7 times |
Joined on Jan 2010
@ dallas, tx usa
|
#2
|
![]() |
2010-02-15
, 16:08
|
|
Posts: 81 |
Thanked: 109 times |
Joined on Apr 2009
@ Brasov/Cluj, Romania
|
#3
|
Hey everyone,
I'm a beginner Python and PyGTK developer so sorry for the stupid question.I have a class named Client which is meant to send data to a server via UDP socket. here is a snippet of the
I get undeclared global variable error for addr and UDPSock.Code:class Client: # Set the socket parameters addr = ('','') UDPSock = socket(AF_INET,SOCK_DGRAM) # callback for getting the IP address def connect_callback(self, widget, entry): hostName = entry.get_text() addr = (hostName,21567) #callback to send the message in the testfield def send_mesg_callback(self, widget, textfield): t_msg = textfield.get_buffer() if(UDPSock.sendto(t_msg,addr)): print "Sending message '",t_msg,"'....." ...
But I can't access my global variables it gives me an error, even when I put a 'self.' infront of the global variables for example infront of UDPSOCK. what am i doing wrong here?
-Thank you
I'm a beginner Python and PyGTK developer so sorry for the stupid question.I have a class named Client which is meant to send data to a server via UDP socket. here is a snippet of the
But I can't access my global variables it gives me an error, even when I put a 'self.' infront of the global variables for example infront of UDPSOCK. what am i doing wrong here?
-Thank you