Re: [Tutor] Ip address

2009-01-20 Thread Lie Ryan
On Mon, 19 Jan 2009 19:47:54 -0800, wormwood_3 wrote: Hello, This is definitely possible. It's more a matter of system and OS configuration than Python though, so you might want to check out some Linux forums ( http://www.linuxforums.org/ ) for additional help. In short, I think the

Re: [Tutor] Ip address

2009-01-20 Thread Irimia, Suleapa
wormwood_3 wrote: Hello, This is definitely possible. It's more a matter of system and OS configuration than Python though, so you might want to check out some Linux forums ( http://www.linuxforums.org/ ) for additional help. In short, I think the simplest would be: Have 3 separate network

[Tutor] Ip address

2009-01-19 Thread Irimia, Suleapa
Hello list, I am new to python and i have a question. I managed to build a client which connect to an website and grab things from there. I run this client on a linux box, which have multiple ip address. What do i want is to run 3 clients and each one to use different ip address to access

Re: [Tutor] Ip address

2009-01-19 Thread wormwood_3
To: irimia.sule...@unknownsoftware.ro Cc: tutor@python.org Sent: Monday, January 19, 2009 10:27:07 AM Subject: Re: [Tutor] Ip address On Mon, Jan 19, 2009 at 8:11 AM, Irimia, Suleapa irimia.sule...@unknownsoftware.ro wrote: Hello list, I am new to python and i have a question. I managed to build a client

[Tutor] IP address parse

2008-08-09 Thread Que Prime
I'm trying to parse a log file for all ip addresses but can't get my RE to work. Thanks in advance for pointing me in the right direction #IP address parse ## import re infile = open(host0_declare.txt,r) outfile = open(out.txt,w) patt =

Re: [Tutor] IP address parse

2008-08-09 Thread Timothy Grant
On Sat, Aug 9, 2008 at 9:57 PM, Que Prime [EMAIL PROTECTED] wrote: I'm trying to parse a log file for all ip addresses but can't get my RE to work. Thanks in advance for pointing me in the right direction #IP address parse ## import re infile =

Re: [Tutor] IP address parse

2008-08-09 Thread Josh Rosen
On Aug 9, 2008, at 10:46 PM, Josh Rosen wrote: There are a few different problems in your code. First off, regular expressions must be passed to re.compile() as strings. patt = re.compile(\[0-9]{1,3})\.(\[0-9]{1,3})\.(\[0-9]{1,3})\. (\[0-9]{1,3}) should read patt =

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":

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().

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 that will work on

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

[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

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

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