Hướng dẫn python file append not working - nối thêm tập tin python không hoạt động

Vì vậy, hầu hết mã này là của riêng tôi, lời xin lỗi cho thực tế nó có thể là một mớ hỗn độn và/hoặc được viết khủng khiếp, nhưng câu hỏi của tôi là tại sao các dòng

D = open("C:\\aPATH\\hPROC.txt", "a")
D.write("End") 

không nối thêm "kết thúc" ở dưới cùng của tệp bất cứ khi nào nó được gọi.

import time

def replace_all(text, rps):
    for i, j in rps.items():
        text = text.replace(i, j)
    return text

def replacer():
    inf = "hScrape.txt"
    ouf = "hPROC.txt"
    A = open(inf, "r")
    B = open(ouf, "w")
    reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
    txt = replace_all(A.read(), reps)
    B.write(txt)
    A.close
    B.close

    D = open("C:\\aPATH\\hPROC.txt", "a")
    D.write("End")

    C = open("C:\\aPATH\\Result.txt", "w+")
    print("Completed Filtering Sequence")
    time.sleep(3)


    while True:
        B = open("hPROC.txt", "r")
        z = B.readline()
        print(z)
        if "End" in z:
            C.write("DN")
            break
        else:
            if z != "\n":
                if " " not in z:
                    if int(z) < 10:
                        C.write("0" + z)
                    else:
                        C.write(z)

replacer()

Tại sao chế độ phụ lục không hoạt động trong Python?

Hiển thị hoạt động trên bài viết này. Điều này đang xảy ra vì bạn không thực sự mở cùng một tệp. Bạn đang yêu cầu người dùng đầu vào chỉ định vị trí của tệp để đọc tệp đó, nhưng nếu họ chọn "nối" tệp, bạn có chúng nối vào một tệp không liên quan gì đến tệp họ chỉ định.not a string representing the file's location. This is an object representing the file.

FileName = open(input("Enter file name: "))

Bạn có thể nối một tệp hiện có trong Python không?

In nội dung của các tệp trước khi thêm vào hàm đọc (). Đóng cả hai tệp bằng hàm đóng (). Mở tệp thứ nhất ở chế độ phụ lục và tệp thứ hai ở chế độ đọc. Nối nội dung của tệp thứ hai vào tệp thứ nhất bằng hàm write ().

    with open("FileName","a") as file:
        file.write(Append)

Làm thế nào để phụ lục hoạt động trong các tệp python?

Để nối một dòng mới của bạn, bạn cần mở tệp ở chế độ nối, bằng cách đặt "A" hoặc "AB" làm chế độ. Khi bạn mở với chế độ "A", vị trí ghi sẽ luôn ở cuối tệp (một phần phụ).

Điều này đang xảy ra vì bạn không thực sự mở cùng một tệp. Bạn đang yêu cầu người dùng đầu vào chỉ định vị trí của tệp để đọc tệp đó, nhưng nếu họ chọn "nối" tệp, bạn có chúng nối vào một tệp không liên quan gì đến tệp họ chỉ định. Bạn đang có người dùng nối một tệp có tên là "FileName". Bạn đã mã hóa chuỗi đó là vị trí của tệp khi người dùng chọn "nối".

Như đã nói, hãy xem xét làm cho đoạn mã mã của bạn trông giống mã sau:

filename = input("Enter file name: ")
decision = input("Do you want to read/delete/append to the file?: ")
if decision == "read":
    with open(filename) as file:
        print(file.read())

elif decision == "append":
    append = input("Type what you want to add: ")
    with open(filename, "a") as file:
        file.write(append)

Bạn có thể nối một tệp hiện có trong Python không?

In nội dung của các tệp trước khi thêm vào hàm đọc (). Đóng cả hai tệp bằng hàm đóng (). Mở tệp thứ nhất ở chế độ phụ lục và tệp thứ hai ở chế độ đọc. Nối nội dung của tệp thứ hai vào tệp thứ nhất bằng hàm write ().

  • Làm thế nào để phụ lục hoạt động trong các tệp python?
  • Để nối một dòng mới của bạn, bạn cần mở tệp ở chế độ nối, bằng cách đặt "A" hoặc "AB" làm chế độ. Khi bạn mở với chế độ "A", vị trí ghi sẽ luôn ở cuối tệp (một phần phụ).
  • Bạn có thể nối một tệp hiện có trong Python không?

    In nội dung của các tệp trước khi thêm vào hàm đọc (). Đóng cả hai tệp bằng hàm đóng (). Mở tệp thứ nhất ở chế độ phụ lục và tệp thứ hai ở chế độ đọc. Nối nội dung của tệp thứ hai vào tệp thứ nhất bằng hàm write ().

    Làm thế nào để phụ lục hoạt động trong các tệp python?

    • Để nối một dòng mới của bạn, bạn cần mở tệp ở chế độ nối, bằng cách đặt "A" hoặc "AB" làm chế độ. Khi bạn mở với chế độ "A", vị trí ghi sẽ luôn ở cuối tệp (một phần phụ). Open the file for writing.
    • Cải thiện bài viết Open the file for reading and writing.

    Lưu bài viết

    Đọc Python program to illustrate Append vs write mode.

    Python3

    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    4
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    5
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    6
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    7
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    8
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    9
    FileName = open(input("Enter file name: "))
    
    0
    FileName = open(input("Enter file name: "))
    
    1

    FileName = open(input("Enter file name: "))
    
    2
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    5
    FileName = open(input("Enter file name: "))
    
    4
    FileName = open(input("Enter file name: "))
    
    5
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    9
    FileName = open(input("Enter file name: "))
    
    7
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    9
    FileName = open(input("Enter file name: "))
    
    9
        with open("FileName","a") as file:
            file.write(Append)
    
    0

        with open("FileName","a") as file:
            file.write(Append)
    
    1

        with open("FileName","a") as file:
            file.write(Append)
    
    2

    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    4
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    5
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    6
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    7
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    8
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    9
        with open("FileName","a") as file:
            file.write(Append)
    
    9
    filename = input("Enter file name: ")
    decision = input("Do you want to read/delete/append to the file?: ")
    if decision == "read":
        with open(filename) as file:
            print(file.read())
    
    elif decision == "append":
        append = input("Type what you want to add: ")
        with open(filename, "a") as file:
            file.write(append)
    
    0

    filename = input("Enter file name: ")
    decision = input("Do you want to read/delete/append to the file?: ")
    if decision == "read":
        with open(filename) as file:
            print(file.read())
    
    elif decision == "append":
        append = input("Type what you want to add: ")
        with open(filename, "a") as file:
            file.write(append)
    
    1
    filename = input("Enter file name: ")
    decision = input("Do you want to read/delete/append to the file?: ")
    if decision == "read":
        with open(filename) as file:
            print(file.read())
    
    elif decision == "append":
        append = input("Type what you want to add: ")
        with open(filename, "a") as file:
            file.write(append)
    
    2
    FileName = open(input("Enter file name: "))
    
    1

        with open("FileName","a") as file:
            file.write(Append)
    
    2

    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    4
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    5
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    6
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    7
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    8
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    9
    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    1
    FileName = open(input("Enter file name: "))
    
    1

    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    3
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    7
    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    5
    FileName = open(input("Enter file name: "))
    
    1

    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    3
    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    8

    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    3
    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is London
    TodayTomorrow
    
    0

        with open("FileName","a") as file:
            file.write(Append)
    
    2

    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    4
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    5
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    6
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    7
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    8
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    9
    FileName = open(input("Enter file name: "))
    
    0
    filename = input("Enter file name: ")
    decision = input("Do you want to read/delete/append to the file?: ")
    if decision == "read":
        with open(filename) as file:
            print(file.read())
    
    elif decision == "append":
        append = input("Type what you want to add: ")
        with open(filename, "a") as file:
            file.write(append)
    
    0

    filename = input("Enter file name: ")
    decision = input("Do you want to read/delete/append to the file?: ")
    if decision == "read":
        with open(filename) as file:
            print(file.read())
    
    elif decision == "append":
        append = input("Type what you want to add: ")
        with open(filename, "a") as file:
            file.write(append)
    
    1
    Hello
    This is Delhi
    This is Paris
    This is London
    Today
    1
    FileName = open(input("Enter file name: "))
    
    1

        with open("FileName","a") as file:
            file.write(Append)
    
    2

    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    4
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    5
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    6
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    7
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    8
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    9
    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    1
    FileName = open(input("Enter file name: "))
    
    1

    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    3
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    7"FileName"4
    FileName = open(input("Enter file name: "))
    
    1

    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    3
    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    8

    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    3
    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is London
    TodayTomorrow
    
    0

        with open("FileName","a") as file:
            file.write(Append)
    
    2

    Output:

    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow

    Ví dụ 2: & nbsp; nối dữ liệu từ một dòng mới  Append data from a new line

    Trong ví dụ trên về xử lý tệp, có thể thấy rằng dữ liệu không được thêm vào dòng mới. Điều này có thể được thực hiện bằng cách viết ký tự mới ‘\ n, vào tệp. & Nbsp;

    Python3

    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    4
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    5
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    6
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    7
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    8
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    9
    FileName = open(input("Enter file name: "))
    
    0
    FileName = open(input("Enter file name: "))
    
    1

    FileName = open(input("Enter file name: "))
    
    2
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    5
    FileName = open(input("Enter file name: "))
    
    4
    FileName = open(input("Enter file name: "))
    
    5
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    9
    FileName = open(input("Enter file name: "))
    
    7
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    9
    FileName = open(input("Enter file name: "))
    
    9
        with open("FileName","a") as file:
            file.write(Append)
    
    0

        with open("FileName","a") as file:
            file.write(Append)
    
    1

        with open("FileName","a") as file:
            file.write(Append)
    
    2

    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    4
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    5
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    6
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    7
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    8
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    9
        with open("FileName","a") as file:
            file.write(Append)
    
    9
    FileName = open(input("Enter file name: "))
    
    1

    filename = input("Enter file name: ")
    decision = input("Do you want to read/delete/append to the file?: ")
    if decision == "read":
        with open(filename) as file:
            print(file.read())
    
    elif decision == "append":
        append = input("Type what you want to add: ")
        with open(filename, "a") as file:
            file.write(append)
    
    1
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    19
    FileName = open(input("Enter file name: "))
    
    1

    filename = input("Enter file name: ")
    decision = input("Do you want to read/delete/append to the file?: ")
    if decision == "read":
        with open(filename) as file:
            print(file.read())
    
    elif decision == "append":
        append = input("Type what you want to add: ")
        with open(filename, "a") as file:
            file.write(append)
    
    1
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    22
    FileName = open(input("Enter file name: "))
    
    1

    filename = input("Enter file name: ")
    decision = input("Do you want to read/delete/append to the file?: ")
    if decision == "read":
        with open(filename) as file:
            print(file.read())
    
    elif decision == "append":
        append = input("Type what you want to add: ")
        with open(filename, "a") as file:
            file.write(append)
    
    1
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    25
    FileName = open(input("Enter file name: "))
    
    1

    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    4
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    5
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    6
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    7
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    8
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    9
    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    1
    FileName = open(input("Enter file name: "))
    
    1

    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    3
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    7
    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    5
    FileName = open(input("Enter file name: "))
    
    1

    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    3
    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    8

    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    3
    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is London
    TodayTomorrow
    
    0

        with open("FileName","a") as file:
            file.write(Append)
    
    2

    Output:

    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is London
    TodayTomorrow
    

    Lưu ý: ‘\ n, được coi là một đặc tính đặc biệt của hai byte. ‘\n’ is treated as a special character of two bytes.

    Ví dụ 3: & nbsp; sử dụng với câu lệnh & nbsp; trong python  Using With statement  in Python

    Với tuyên bố được sử dụng trong xử lý ngoại lệ để làm cho mã sạch hơn và dễ đọc hơn nhiều. Nó đơn giản hóa việc quản lý các tài nguyên chung như luồng tệp. Không giống như các triển khai ở trên, không cần phải gọi tệp.close () khi sử dụng với câu lệnh. Bản thân tuyên bố đảm bảo việc mua lại và phát hành tài nguyên thích hợp. & NBSP; is used in exception handling to make the code cleaner and much more readable. It simplifies the management of common resources like file streams. Unlike the above implementations, there is no need to call file.close() when using with statement. The with statement itself ensures proper acquisition and release of resources. 

    Python3

    FileName = open(input("Enter file name: "))
    
    2
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    5
    FileName = open(input("Enter file name: "))
    
    4
    FileName = open(input("Enter file name: "))
    
    5
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    9
    FileName = open(input("Enter file name: "))
    
    7
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    9
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    51
        with open("FileName","a") as file:
            file.write(Append)
    
    0

    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    53
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    6
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    7
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    8
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    9
    FileName = open(input("Enter file name: "))
    
    0
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    59

    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    60
    filename = input("Enter file name: ")
    decision = input("Do you want to read/delete/append to the file?: ")
    if decision == "read":
        with open(filename) as file:
            print(file.read())
    
    elif decision == "append":
        append = input("Type what you want to add: ")
        with open(filename, "a") as file:
            file.write(append)
    
    1
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    62
    FileName = open(input("Enter file name: "))
    
    1

    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    60
        with open("FileName","a") as file:
            file.write(Append)
    
    1

    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    53
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    6
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    7
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    8
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    9
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    71
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    59

    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    60
    filename = input("Enter file name: ")
    decision = input("Do you want to read/delete/append to the file?: ")
    if decision == "read":
        with open(filename) as file:
            print(file.read())
    
    elif decision == "append":
        append = input("Type what you want to add: ")
        with open(filename, "a") as file:
            file.write(append)
    
    1
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    22
    FileName = open(input("Enter file name: "))
    
    1

    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    53
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    6
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    7
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    8
    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    9__182

    import time
    
    def replace_all(text, rps):
        for i, j in rps.items():
            text = text.replace(i, j)
        return text
    
    def replacer():
        inf = "hScrape.txt"
        ouf = "hPROC.txt"
        A = open(inf, "r")
        B = open(ouf, "w")
        reps = {"Result Date:":"", "Draw Result:":"", "Bonus":"", "January":"", "February":"", "March":"", "April":"", "May":"", "June":"", "July":"", "August":"", "September":"", "October":"", "November":"", "December":"", "With Max Millions!":"", "2009":"", "2010":"", "2011":"", "2012":"", "2013":"", "2014":"", "2015":"", "2016":"", "2017":"", "2018":"", "30th":"", "29th":"", "28th":"", "27th":"", "26th":"", "25th":"", "24th":"", "23rd":"", "22nd":"", "21st":"", "20th":"", "19th":"", "18th":"", "17th":"", "16th":"", "15th":"", "14th":"", "13th":"", "12th":"", "11th":"", "10th":"", "9th":"", "8th":"", "7th":"", "6th":"", "5th":"", "4th":"", "3rd":"", "2nd":"", "1st":"", "\t":""}
        txt = replace_all(A.read(), reps)
        B.write(txt)
        A.close
        B.close
    
        D = open("C:\\aPATH\\hPROC.txt", "a")
        D.write("End")
    
        C = open("C:\\aPATH\\Result.txt", "w+")
        print("Completed Filtering Sequence")
        time.sleep(3)
    
    
        while True:
            B = open("hPROC.txt", "r")
            z = B.readline()
            print(z)
            if "End" in z:
                C.write("DN")
                break
            else:
                if z != "\n":
                    if " " not in z:
                        if int(z) < 10:
                            C.write("0" + z)
                        else:
                            C.write(z)
    
    replacer()
    
    60
    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    3
    Output of Readlines after appending
    This is Delhi
    This is Paris
    This is LondonToday
    
    
    Output of Readlines after writing
    Tomorrow
    8

    Output:

    Hello
    This is Delhi
    This is Paris
    This is London
    Today

    LƯU Ý: Để biết thêm về tuyên bố bấm vào đây. To know more about with statement click here.


    Tại sao chế độ phụ lục không hoạt động trong Python?

    Hiển thị hoạt động trên bài viết này.Điều này đang xảy ra vì bạn không thực sự mở cùng một tệp.Bạn đang yêu cầu người dùng đầu vào chỉ định vị trí của tệp để đọc tệp đó, nhưng nếu họ chọn "nối" tệp, bạn có chúng nối vào một tệp không liên quan gì đến tệp họ chỉ định.you're not actually opening the same file. You're asking the user for input to specify a file's location for reading that file, but should they choose to "append" the file, you have them append to a file that has nothing to do with the file they specified.

    Bạn có thể nối một tệp hiện có trong Python không?

    In nội dung của các tệp trước khi thêm vào hàm đọc ().Đóng cả hai tệp bằng hàm đóng ().Mở tệp thứ nhất ở chế độ phụ lục và tệp thứ hai ở chế độ đọc.Nối nội dung của tệp thứ hai vào tệp thứ nhất bằng hàm write ().

    Làm thế nào để phụ lục hoạt động trong các tệp python?

    Để nối một dòng mới của bạn, bạn cần mở tệp ở chế độ nối, bằng cách đặt "A" hoặc "AB" làm chế độ.Khi bạn mở với chế độ "A", vị trí ghi sẽ luôn ở cuối tệp (một phần phụ).open the file in append mode , by setting "a" or "ab" as the mode. When you open with "a" mode , the write position will always be at the end of the file (an append).