[BangPypers] mac IP

Sriram Narayanan sriramnrn at gmail.com
Sun Apr 17 05:26:47 CEST 2011


If it's machine setup, then please use either puppet or chef or func.
You'll get a lot by way of features.

-- Ram

On 4/15/11, Nitin Kumar <nitin.nitp at gmail.com> wrote:
> the reason for the same is:
>
> We got to machine setup, one is US and one in India, according to machine
> location we need to use local server.
> So I was looking for IP which help me differentiate the position of client
> Machine to use that to chose server.
>
> thanks
> Nitin K
>
> On Thu, Apr 14, 2011 at 6:28 PM, Santosh Rajan <santrajan at gmail.com> wrote:
>
>> I think the solution below will give you all the ip addresses including
>> 127.0.0.1. In any case this is not an easy one to solve. Depends on a lot
>> of
>> factors. You might want to revisit your original question on why you want
>> the ip address? and which ip address (local or inet)?, and investigate
>> wether you really need the ip address to solve the problem?
>>
>> On Thu, Apr 14, 2011 at 5:46 PM, Sudharshan Gupta <
>> sudharshan.gupta at in.fiorano.com> wrote:
>>
>> > Hi nitin,
>> >
>> > I think this works
>> > import socket
>> > socket.gethostbyname(socket.gethostname())
>> > socket.gethostbyname_ex(socket.gethostname())
>> >
>> >
>> >
>> >
>> >
>> > Nitin Kumar wrote:
>> >
>> >> Hi All,
>> >>
>> >> Is anyone aware how to fetch mac machine IP using python?
>> >>
>> >>
>> >>
>> >
>> >
>> > --
>> > Thanks & Regards
>> > Sudharshan
>> >
>> >
>> > _______________________________________________
>> > BangPypers mailing list
>> > BangPypers at python.org
>> > http://mail.python.org/mailman/listinfo/bangpypers
>> >
>>
>>
>>
>> --
>> http://about.me/santosh.rajan
>>
>> “The *young man* knows the rules but the *old man* knows the
>> exceptions”. *Oliver
>> Wendell Holmes*
>> _______________________________________________
>> BangPypers mailing list
>> BangPypers at python.org
>> http://mail.python.org/mailman/listinfo/bangpypers
>>
>
>
>
> --
> Nitin K
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>

-- 
Sent from my mobile device

==================
Belenix: www.belenix.org


More information about the BangPypers mailing list