Re: [Tutor] IP Address from Python module?

2005-08-08 Thread Joseph Quigley
Danny Yoo wrote: Hi Joe, That actually sounds right in a sense. Any internet address with '192.168.x.x' is a "local" IP address, and is commonly allocated to folks on an internal network. For the really dull details about this, see RFC 1918 on "Private Address Space": http://www.faqs

Re: [Tutor] IP Address from Python module?

2005-08-07 Thread Danny Yoo
> >I think you're looking for socket.gethostbyname(). > > > >http://www.python.org/doc/lib/module-socket.html#l2h-2594 > > > >Here's an example using the socket.gethostbyname() function: > > > >http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/335890 > > > > > Oh.. btw I don't think

Re: [Tutor] IP Address from Python module?

2005-08-07 Thread Joseph Quigley
Danny Yoo wrote: >On Fri, 5 Aug 2005, Joseph Quigley wrote: > > > >>Is it possible to get my internet and/or network IP address from Python? >>Is there any other way to get it? >> >> > >Hi Joe, > >I think you're looking for socket.gethostbyname(). > >http://www.python.org/doc/lib/module-

Re: [Tutor] IP Address from Python module?

2005-08-06 Thread Joseph Quigley
Thanks.. I hoped python had something like that!!! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] IP Address from Python module?

2005-08-05 Thread Terry Carroll
On Fri, 5 Aug 2005, Joseph Quigley wrote: > Is it possible to get my internet and/or network IP address from Python? import socket ipaddr = socket.gethostbyname(socket.gethostname()) Some users report this gives a meaningless '127.0.0.1' (i.e., localhost), though. But try it and see. It work

Re: [Tutor] IP Address from Python module?

2005-08-05 Thread Danny Yoo
On Fri, 5 Aug 2005, Joseph Quigley wrote: > Is it possible to get my internet and/or network IP address from Python? > Is there any other way to get it? Hi Joe, I think you're looking for socket.gethostbyname(). http://www.python.org/doc/lib/module-socket.html#l2h-2594 Here's an example

[Tutor] IP Address from Python module?

2005-08-05 Thread Joseph Quigley
Is it possible to get my internet and/or network IP address from Python? Is there any other way to get it? Oh. If you're wondering what I mean by Internet and/or network IP I'm talking about the 4 sequence IP (IPv4) (used primarily in small networks) and the 6 sequence IP (IPv6) found on the inte