how to make from real IP into automatic IP range in python? : <p>how do I make an IP range, for example my original IP there are the first 2 127.0.0.1 the second 128.0.0.1, I want if I use that IP for the IP range will be: 127.0.0.1 - 127.0.255.255 and so on, this my example code :</p>

<pre><code>list_data = ["127.0.0.1", "128.0.0.1"]
for i in range(255):
    for j in range(255):
        ip = list_data+".%d.%d" % (i, j)
        print (sb+fg+'[RANGE-IP]   ===&gt;   '+ip)
        open('IP.txt', 'a').write(ip + "\n")
</code></pre>
