On Tue, Feb 20, 2018 at 3:49 AM, Wildman via Python-list <python-list@python.org> wrote: > On Mon, 19 Feb 2018 12:32:49 +0000, Rhodri James wrote: > >> On 18/02/18 16:18, Wildman via Python-list wrote: >>>> But that's only going to show one (uplink) address. If I needed to get >>>> ALL addresses for ALL network adapters, I'd either look for a library, >>>> and if one wasn't easily found, I'd shell out to the "ip" command and >>>> parse its output.:) >>>> >>> I considered using the "ip" command but I prefer not to >>> depend on external programs if I can get around it. I >>> know that might be considered silly but that's just me. >> >> It's not silly at all, but for Linux networking it might be the best >> idea. I believe in theory you are supposed to use libnl (in some >> suitable wrapping), but my experience with that is that it is badly >> documented and horrendously unreliable. > > It looks like libnl would do what I want but there is > a problem. When finished, my program will be released > in the form of a Debian (*.deb) package and used by, > for the most part, 'average' Linux users. These are > people that know their way around Linux but know > nothing or very little about Python. Installing a > package using pip by them is pretty much out of the > question. The system's package manager must be able > to handle the program's dependencies so third-party > packages are out of the question. > > But thanks for the suggestion.
If you're distributing it as a .deb, you don't want to use pip to grab additional libraries. Ideally, you'd want the library to *also* be available through the package manager, which would mean you can simply record it as a dependency. If it's not... it's not gonna be easy. ChrisA -- https://mail.python.org/mailman/listinfo/python-list