\n "unexpected character after line continuation character"
<p>I have a recurring problem when trying to use \n in python. I'm trying to get the code to write to a text file after extracting data from another text file howeve when i run the code it always shows a  "unexpected character after line continuation character" error after the \n.  This is the code i am currently using. </p>

<pre><code>while True:
 while True:
    try:
        Prod_Code = input("enter an 8 digit number or type Done to get your final receipt: ")
        check = len(Prod_Code)
        int(Prod_Code) 

        if check == 8:
            print("This code is valid")



            with open('Data Base.txt', 'r') as searchfile:
                for line in searchfile:
                    if Prod_Code in line:
                        print(line)
                        receipt = open('Receipt.txt', 'w')
                        receipt.write(line, \n)
                        receipt.close()
                        break

        else:
            print("incorrect length, try again")

    except ValueError:
        if Prod_Code == "Done":
            print("Your receipt is being calculated")
            exit()

        else:
             print("you must enter an integer")
</code></pre>