import csv
#import txt file
imprtTxt = open("logs_353.txt","r", encoding = 'UTF-8')
data = imprtTxt.readline()
resultCsv = open("resultcsv.csv","w")
resultCsv.write("onRegistered \n")
resultCsv.write(data)
imprtTxt.close()
#resultCsv.close()
์ฐธ๊ณ ๋งํฌ
https://codechacha.com/ko/python-read-write-file/
Python - Text ํ์ผ ์ฝ๊ณ ์ฐ๋ ๋ฐฉ๋ฒ (read, write, append)
Text file์ ์ฝ๊ณ ์ฐ๋ ๋ฐฉ๋ฒ์ ์๊ฐํฉ๋๋ค. C, Java์์ ํ์ผ์ ์ฝ๊ณ ์ฐ๋ ๋ฐฉ๋ฒ๊ณผ ์ ์ฌํฉ๋๋ค. Access mode๊ฐ ์์ด์ ์ฝ๊ธฐ ์ ์ฉ์ผ๋ก ํ์ผ์ ์ฌ์ฉํ ๊ฒ์ธ์ง, ์ฐ๊ธฐ ์ ์ฉ์ผ๋ก ํ์ผ์ ์ฌ์ฉํ ๊ฒ์ธ์ง ์ ํ ์
codechacha.com
'Programming > Python' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| [python] VS code ๊ฐ๋ฐํ๊ฒฝ์ ํ (0) | 2021.11.16 |
|---|