1
postoption=input("Press 1 to leave a post, and 2 to close The Wall.")
        if postoption=="2":
            print("Wall closed.")
        elif postoption=="1":
            wally=pickle.load(open("The Wall.txt","rb"))
            usernamey=pickle.load(open("username1.txt","rb"))
            wu="\n",(wally),"\n",(usernamey)
            apost=input("Enter your post below: \n")
            pwickle=pickle.dump((wu, apost), open("The Wall.txt","wb"))
            print(pwickle)
        else:
            print("Wall closed.")

このコードは、.txt ファイルに保存されているものを再読み込みしているため、改行の代わりに "\n" を残します。これを止める最も簡単な方法は何ですか?

4

0 に答える 0