import os

# ファイルが存在するか確認


def create(params):
    with open(params, 'w', encoding='utf-8') as file:
        pass


create('new_file.txt')

def description(params,A):
    if os.path.exists(params):
        with open(params, 'a', encoding='utf-8') as file:
            file.write(A)

for name in range(10):
    description('new_file.txt',"追記\n")


with open('new_file.txt', 'r', encoding='utf-8') as file:
    print(file.read())


    

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: