Another possibility that directly gives the right result and uses
ifconfig:
$ ifconfig | grep 'inet '| grep -v '127.0.0.1' | cut -d: -f2 | awk '{
print $1}'
That said, I don't know if the "inet" string stays the same in every
locale, though.
--
sysmonitor screenlet fails to find the computer's
Something like this should work:
def net_get_ip(): # by Whise
"""Returns ip if it can"""
ip = commands.getoutput("ip -o -4 addr show")
x = 0
while True:
ip = ip[ip.find("inet "):]
ip = ip[5:]
ipc = ip[:ip.find("/")]
Yes, there is another way: using the command ip from the net-tools package
instead of ifconfig. This package is installed by default in Ubuntu. Don't know
for other distributions.
Use it like this:
$ ip addr show
On my machine, it prints this:
$ ip addr show
1: lo: mtu 16436 qdisc noqueue sta
My analysis of the problem was quite weak, sorry On MY machine, ifconfig still
returns "inet adr" with only one "d".
Actually, the problem is a problem of locale. In your english ( I presume)
version, it has two "d" but in mine which is a french version of Maverick,
"inet adr" has only one "d".
Ubuntu)
> Status: New => Incomplete
>
--
Michel Leunen
http://linux.leunen.com
--
sysmonitor screenlet fails to find the computer's IP address
https://bugs.launchpad.net/bugs/618868
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscri
Public bug reported:
Binary package hint: screenlets
Using Ubuntu 10.04.1 with screenlets 0.1.2-7ubuntu1
The screenlet sysmonitor doesn't return an IP address but an empty string. This
is due to a bug in the function net_get_ip().
Here is the content of the function screenlets.sensors.net_get_ip
** Attachment added: "patch for xvidcap source in Lucid"
http://launchpadlibrarian.net/49014739/xvidcap.patch
--
error when compiling xvidcap from sources
https://bugs.launchpad.net/bugs/584926
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to
Public bug reported:
Binary package hint: xvidcap
When compiling xvidcap from sources in Lucid, we've got an error in the
file capture.c during the 'make' process:
capture.c: In function ‘XGetZPixmapSHM’:
capture.c:668: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
‘*’ token
ca