file
ํ์ผ ์ด๊ณ ๋ซ๊ธฐ : open(), close()
file = open("basic.txt", "w") # w : write๋ชจ๋ (์๋ก์ฐ๊ธฐ ๋ชจ๋)
file.write("Hello Python Programming...!")
file.close()with ํค์๋
with open(๋ฌธ์์ด: ํ์ผ๊ฒฝ๋ก, ๋ฌธ์์ด: ๋ชจ๋) as ํ์ผ ๊ฐ์ฒด: ๋ฌธ์ฅwith open("basic.txt", "w") as file: file.write("Hello Python Programming...!")
ํ
์คํธ ์ฝ๊ธฐ : read()
ํ
์คํธ ์ฝ๊ธฐ : readline()
ํ
์คํธ ์ฝ๊ธฐ :readlines()
ํ
์คํธ ํ ์ค์ฉ ์ฝ๊ธฐ : CSV
Last updated