[EMAIL PROTECTED] wrote:
Liam Clarke wrote:
[ snip ]
- increment an IP. This is the hardest part.
Why? An ip (V4) is just an 32bit integer :-)
The problem arises from the representation.
Use something like
"http://pynms.sourceforge.net/ipv4.html";
to switch between the various representations.
>> Liam Clarke wrote:
> [ snip ]
>> - increment an IP. This is the hardest part.
> Why? An ip (V4) is just an 32bit integer :-)
Indeed. Some early versions of MacTCP for MacOS made you input the
address as a single large decimal number :^)
Alan
___
> Liam Clarke wrote:
[ snip ]
> - increment an IP. This is the hardest part.
Why? An ip (V4) is just an 32bit integer :-)
The problem arises from the representation.
Use something like
"http://pynms.sourceforge.net/ipv4.html";
to switch between the various representations.
> Kent
HTH and Gree
Liam Clarke wrote:
Hi, you could save yourself some hassle and do
minipstr = '1.0.0.1'
maxipstr = '1.0.15.16'
minip = map(int, minipstr.split('.'))
maxip = map(int, maxipstr.split('.'))
iplist = []
for a in range(minip[2], maxip[2]+1):
... if a < maxip[2]:
... for b in range(minip[
Erp.
-- Forwarded message --
From: Liam Clarke <[EMAIL PROTECTED]>
Date: Sun, 20 Feb 2005 23:42:43 +1300
Subject: Re: [Tutor] Create list of IPs
To: Ralfas Jegorovas <[EMAIL PROTECTED]>
Hi, you could save yourself some hassle and do
>>> minipstr = &
> Date: Sun, 20 Feb 2005 23:42:43 +1300
> Subject: Re: [Tutor] Create list of IPs
> To: Ralfas Jegorovas <[EMAIL PROTECTED]>
>
> Hi, you could save yourself some hassle and do
>
> >>> minipstr = '1.0.0.1'
> >>> maxipstr = '1.0.15.1
I am wondering how I would go about making a list of IPs between two set
IPs.
This is my initial code:
def list2str(list):
ip=''
for part in list:
if len(ip)!=0:
ip=ip+'.'+part
else:
ip=ip+part
return ip
iplist = []
minip = ['1','0','0','1'] # startin