<div>I am trying to get my ip address through a script and I am using the following code:</div>
<div> </div>
<div>import socket</div>
<div> </div>
<div>ip = socket.gethostbyaddr(socket.gethostname())</div>
<div> </div>
<div> </div>
<div> </div>
<div>ip then becomes a tuple and takes on three values. I am trying to pull the value of ip[2] which when printed displays:</div>
<div>['<a href="http://10.5.100.17">10.5.100.17</a>'].</div>
<div> </div>
<div>I want this ip that is being returned, but I would like it as a string, without the [' and ']. Any idea how I would trim this down?</div>
<div> </div>
<div> </div>