<div>So I have a  script, first part of a script that I am making to determine each possible combination of IP addresses that are out there.</div>
<div> </div>
<div>This part is just to get the end of the IP (the last 3 digits). So, they are from 0 - 255. I just want to print 0 - 255, HOWEVER</div>
<div> </div>
<div>If the number is only say ... 3, then I want mySet to be 003, not 3. I need to add the zeros to the front. </div>
<div>My code is below - I guess that there is something to do with my variable types etc. I am not used to the way that Python handles variable types so I am kind of lost, can anyone help ...</div>
<div> </div>
<div><font size="2">
<p># Script to Evaluate every possible IP Address Combo</p>
<p># 9/15/05</p>
<p>def ZeroThrough255():</p>
<p>x = 0</p>
<p>while x <= 255:</p>
<p>if len(x) == 1:</p>
<p>mySet = '00' + str(x)</p>
<p>elif len(x) == 2:</p>
<p>mySet = '0' + str(x)</p>
<p>else:</p>
<p>mySet = x</p>
<p>print mySet</p>
<p>x +=1 </p>
<p>ZeroThrough255()</p>
<p>--------------------</p></font>The file is also attached.<br clear="all"><br>-- <br>edward hotchkiss </div>