Re: Python Global variable

2013-08-26 Thread MRAB
On 26/08/2013 10:54, chandan kumar wrote: Hi all, Please see the below code,in which i'm verifying the global value in python. CHK=10 def test1(): print "Value of CHK in test1",CHK def test2(): CHK=40 print "Value of CHK in test2",CHK test1() def test3(): global CH

Re: Python Global variable

2013-08-26 Thread Joel Goldstick
On Mon, Aug 26, 2013 at 5:54 AM, chandan kumar wrote: > Hi all, > > Please see the below code,in which i'm verifying the global value in python. > > CHK=10 > > def test1(): > print "Value of CHK in test1",CHK > > def test2(): > CHK=40 > print "Value of CHK in test2",CHK > test1()

Python Global variable

2013-08-26 Thread chandan kumar
Hi all, Please see the below code,in which i'm verifying the global value in python. CHK=10 def test1(): print "Value of CHK in test1",CHK def test2(): CHK=40 print "Value of CHK in test2",CHK test1() def test3(): global CHK test2() test3() When i ran above code ,I

Re: python global variable error

2007-03-16 Thread Sönmez Kartal
Then after defining clientsock, write a print statement as "print clientsock", see what it will print, None or a object? Sönmez ANIL KARADAĞ wrote: > ok , arranged block.but program give error global name 'clientsock' is not > defined " ,.. > > 2007/3/17, Sönmez Kartal <[EMAIL PROTECTED]>: >> >

python global variable error

2007-03-16 Thread ANIL KARADAĞ
hi, i made a program in python but received global name error. the program code; serverhost = '127.0.0.1' serverport = 2000 BUFSIZ = 1024 addr = (serverhost,serverport) if str(sys.argv).find("-s") == -1: cs = socket(AF_INET, SOCK_STREAM,0) # create a TCP socket cs.c