fname = "list.txt"

def rstripfile():
    res = []
    with open(fname,'r') as f:
        line = f.readline().rstrip()
        while line != "":
            res.append(line)
            line = f.readline().rstrip()
    print("[+] rstripfile completed")
    return res

def writefile(rlist):
    with open("rlist.txt",'w') as f:
        for i in rlist:
            f.write(i + "\n")
    f.close()
    print("[+] writefile completed")
    pass

res = rstripfile()
writefile(res)