I have this code:
def ranges(ip):
    try:
        part = ip.split('.')
        a = part[0]
        b = part[1]
        c = part[2]
        d = part[3]
        for c in range(1, 256):
                 for d in range(1, 256):
                     ip_result = (str(a) + '.' + str(b) + '.' + str(c) + '.' + str(d))
                     print(ip_result, end='\r')
                     open('IpRanged.txt','a').write(ip_result+"\n")
    except:
        ... 
It is supposed to show each output on the same line of the terminal, but it does not properly show every output. What is wrong, and how do I fix it?
 
    