[CentralOH] SheevaPlug - Python app right out of the box!

Jon Miller jonebird at gmail.com
Thu Apr 1 15:36:41 CEST 2010


This is what I do to determine my frontend IP:
  INTERFACE=$(/sbin/ip route list default | sed -n '/^default /s/.*
dev \([a-z0-9]*\) $/\1/p' | head -1)
  /sbin/ip addr show dev $INTERFACE primary | sed -n '/inet /s/.*inet
\([^ ]*\) .*$/\1/p' | sed 's|/24||g'

-- Jon

On Thu, Apr 1, 2010 at 9:03 AM, Mark Erbaugh <mark at microenh.com> wrote:
> Has anyone in the COhPy messed with a SheevaPlug? This is a "plug computer" that comes preloaded with a version of Ubuntu 9.04 and, more importantly, Python 2.5 is installed. I have a small (but useful) web-based app written using webpy. I simply copied the files to a USB memory stick. Once I mounted the memory stick on the SheevaPlug, I issued the command 'python main.py' and my app was off an running. Pretty cool!
>
> I have a question related to my webpy app.  Is there some python code for determining the IP address on which it is listening?  When the webpy app runs, it always displays http://0.0.0.0:8080/.  I end up having to use ifconfig to get the IP address.
>
> Mark
> _______________________________________________
> CentralOH mailing list
> CentralOH at python.org
> http://mail.python.org/mailman/listinfo/centraloh
>


More information about the CentralOH mailing list