Web lists-archives.com

Re: get my ip address

On Fri, Feb 15, 2019 at 11:11:29AM +0100, tony wrote:
> Hi all,
> Debian 9. I need to read my IPv6 address into a python script.

You don't have "an IP address". Your host has, and it has zero or
more (potentially many) IP addresses. With IPV6, you'll almost
certainly end up with more than one per interface.

> I am aware that I can call ip a and parse the result. The parsing,
> whilst quite achievable, is slightly tricky, but I can manage the RE, so
>  that's not my question.
> Is there any other way to obtain this data, maybe from /sys?

Try a DuckDuckGo search for ["IP address" site:docs.python.org/3]

Here [1] is a link for your convenience.

[1] https://duckduckgo.com/html?q=%22IP%20address%22+site:docs.python.org/3
-- tomás

Attachment: signature.asc
Description: Digital signature