[Tutor] array('c')

Ian D duxbuz at hotmail.com
Thu May 1 16:38:44 CEST 2014


Hi


I have this part of code and am unsure as to the effect of the array('c') part.


Is it creating an array and adding 'c' as its first value?


This does not seem to be the case.


Thanks


n = len(cmd)
       a = array('c')
       a.append(chr((n>> 24) & 0xFF))
       a.append(chr((n>> 16) & 0xFF))
       a.append(chr((n>>  8) & 0xFF))
       a.append(chr(n & 0xFF))
       scratchSock.send(a.tostring() + cmd) 		 	   		  


More information about the Tutor mailing list