<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">That telnet localhost gpsd command simply makes a socket connection<br>

and prints what it receives, you don&#39;t need getpass, telnetlib or gzip<br>
python modules.  If I&#39;m right you could even just pipe the socket into<br>
your program using bash<br>
<br>
./python-program &lt; /dev/tcp/localhost/2947<br>
</blockquote><div><br>Yes I was looking into socket programming.This code does not output the gps data :<br> <br></div></div><span style="color: rgb(51, 51, 255);">import sys</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">import socket</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">s.bind((&#39;127.0.0.1&#39;, 2947))</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">while True:</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">    line = s.recv(1024)</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">    sys.stdout.write(line)</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">    sys.stdout.flush()</span><br><br>Any suggestion as to why it dint work?It compiles fine.<br><br>Sriranjan<br>