Re: [Tutor] print IP address range to stdout

2009-12-23 Thread MK
Am Dienstag, den 22.12.2009, 19:09 +0100 schrieb spir: > MK dixit: > > > First function the ip is splitted as i did it. Alright. > > The use 256 as it is the maximum for any digit. ok. > > But what is that ** and exp meaning > > > > --

Re: [Tutor] print IP address range to stdout

2009-12-22 Thread Dave Angel
Rich Lovely wrote: 2009/12/22 MK : Ok. That was very helpful. As i dont know how to do it i googled and found this one: http://anonymouse.org/cgi-bin/anon-www.cgi/http://snipplr.com/view/14807/convert-ip-to-int-and-int-to-ip/ But frankly i dont understand it. The program works now like it sh

Re: [Tutor] print IP address range to stdout

2009-12-22 Thread spir
MK dixit: > First function the ip is splitted as i did it. Alright. > The use 256 as it is the maximum for any digit. ok. > But what is that ** and exp meaning > > -- > def ip_to_int(dotted_ip): > exp = 3 > intip = 0 >

Re: [Tutor] print IP address range to stdout

2009-12-22 Thread Rich Lovely
2009/12/22 MK : > Ok. That was very helpful. As i dont know how to do it i googled > and found this one: > http://anonymouse.org/cgi-bin/anon-www.cgi/http://snipplr.com/view/14807/convert-ip-to-int-and-int-to-ip/ > > But frankly i dont understand it. The program works now like it should > but i wan

Re: [Tutor] print IP address range to stdout

2009-12-22 Thread MK
Ok. That was very helpful. As i dont know how to do it i googled and found this one: http://anonymouse.org/cgi-bin/anon-www.cgi/http://snipplr.com/view/14807/convert-ip-to-int-and-int-to-ip/ But frankly i dont understand it. The program works now like it should but i want to understand the code i

Re: [Tutor] print IP address range to stdout

2009-12-22 Thread Alan Plum
Hi again, On Di, 2009-12-22 at 12:46 +0100, Alan Plum wrote: > # Now generate the addresses: > for ip in range(start, end+1): > blocks = [] > for i in range(4): > blocks.append((ip & (0xff << (8 * i))) >> (8 * i)) > print '.'.join(blocks) I just realised this gives you the blo

Re: [Tutor] print IP address range to stdout

2009-12-22 Thread Alan Plum
On Di, 2009-12-22 at 10:53 +0100, MK wrote: > Here is my program so far: > Please translate comments if you post to an English list. Not everyone speaks German. > The start_adress and end_adress are the ip-range. > > For example: > printdomains.py -s 192.168.178.0 -e 193.170.180.4 > > This sho

Re: [Tutor] print IP address range to stdout

2009-12-22 Thread Dave Angel
MK wrote: Hi there, i have some logical problem. I dont get it done to write my for loops in that way that the ip address range which is given as arguments are correct processed. Meaning that only the ips are printed which the user defines as argument. I tried to make an if statement to stop a

Re: [Tutor] print IP address range to stdout

2009-12-22 Thread Alan Plum
On Di, 2009-12-22 at 10:53 +0100, MK wrote: > Hi there, > > i have some logical problem. I dont get it done to write my for loops in > that way that the ip address range which is given as arguments are > correct processed. Meaning that only the ips are printed which the > user defines as argument.

[Tutor] print IP address range to stdout

2009-12-22 Thread MK
Hi there, i have some logical problem. I dont get it done to write my for loops in that way that the ip address range which is given as arguments are correct processed. Meaning that only the ips are printed which the user defines as argument. I tried to make an if statement to stop at the end_adre