파이썬에서 빈 파일을 만드는 방법

방법 1 열기 :

import os

file_name = "123.txt"
open(file_name, "w")

방법 2 pathlib :

import pathlib

file_name = "123.txt"
pathlib.Path(file_name).touch()

 

 

추천

출처blog.csdn.net/whatday/article/details/113783540