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