Show current ip on Linux

Qiangning Hong hongqn at gmail.com
Mon Jun 13 11:34:34 EDT 2005


David Van Mosselbeen wrote:
> Hi,
> Im a newbie in Python, and also in Fedora Core 3. (Yes, Linux is fine
> man :-)
> 
> My question is : How can i rwite a script that show my current ip. If i have
> more than one network card, the script must then show all used ip.
> 
> It's important that this will work on a linux. i Have rwite some piece of
> code that realy work under Windows XP, but the same script wil not work on
> Linux. 
> 
> Verry thanks to all vulunteers.
> 

How about use the shell command "ifconfig | grep inet" ?


-- 
Qiangning Hong

 _____________________________________________________________
( <zhen> so <zhen> when I do a chroot /path /bin/bash, i can  )
( see the processes                                           )
(                                                             )
( outside of the chroot <zhen> and i can kill those processes )
( * klieber claps for zhen <zhen> oh go die                   )
 -------------------------------------------------------------
       o   \_______
 v__v   o  \   O   )
 (OO)      ||----w |
 (__)      ||     ||  \/\




More information about the Python-list mailing list