Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ファイルを編集したいのですが、送信する新しいテキストは一番下の行ではなく最初の行になります。私はこれを使用します:
with open("OUTPUT.txt", "a") as myfile: myfile.write("row #2 text") myfile.write("\nrow #1 text")
ただし、テキストを新しい行に追加するだけです。
ありがとう
解決しました!