<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 14px/normal Calibri; ">I was not sure if this message was sent before my membership was accepted.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 14px/normal Calibri; min-height: 17px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 14px/normal Calibri; ">Please disregard if it's a duplicate.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 14px/normal Calibri; min-height: 17px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 14px/normal Calibri; ">Thanks</div><div><br><div>Begin forwarded message:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>From: </b></span><span style="font-family:'Helvetica'; font-size:medium;">Johnny Venter <<a href="mailto:Johnny.Venter@zoho.com">Johnny.Venter@zoho.com</a>><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>Date: </b></span><span style="font-family:'Helvetica'; font-size:medium;">August 5, 2011 8:15:53 AM EDT<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>To: </b></span><span style="font-family:'Helvetica'; font-size:medium;"><a href="mailto:python-list@python.org">python-list@python.org</a><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>Subject: </b></span><span style="font-family:'Helvetica'; font-size:medium;"><b>Sockets: Receiving C Struct</b><br></span></div><br><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">New to python and would like to test network/sockets with it.<div><br></div><div>I am having a problem where I have setup the following:</div><div><br></div><div><div><font class="Apple-style-span" color="#0034ff">import socket, sys, struct</font></div><div><font class="Apple-style-span" color="#0034ff"><br></font></div><div><font class="Apple-style-span" color="#0034ff">HOST = '1.1.1.1'</font></div><div><font class="Apple-style-span" color="#0034ff">PORT = 153</font></div><div><font class="Apple-style-span" color="#0034ff">s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)</font></div><div><font class="Apple-style-span" color="#0034ff">s.connect((HOST, PORT))</font></div><div><font class="Apple-style-span" color="#0034ff"><br></font></div><div><font class="Apple-style-span" color="#0034ff">data = struct.unpack('!I',s.recv(4))[0]</font></div><div><font class="Apple-style-span" color="#0034ff"><br></font></div><div><font class="Apple-style-span" color="#0034ff">s.close()</font></div></div><div><font class="Apple-style-span" color="#0034ff"><br></font></div><div><font class="Apple-style-span" color="#0034ff">print data</font></div><div><font class="Apple-style-span" color="#0034ff"><br></font></div><div><font class="Apple-style-span" color="#0034ff"><br></font></div><div>What I would like to do is take the input from the server, and store it in an array.  The type of data is int.</div><div><br></div><div>Can someone help?</div><div><br></div><div><br></div><div>Thanks, Johnny</div><div><br></div></div></blockquote></div><br></div></body></html>