본문 바로가기
프로그래밍/Python

Python 파일쓰기

by 그레이 후드 2017. 8. 9.
728x90

# Export data to csv file


import csv


f = open('output.csv', 'w+', encoding='utf-8', newline='')

wr = csv.writer(f)


people = ["A","B","C"]

n = 0


for n in range(0, 3):

    wr.writerow([n, people[n]])


f.close()


쉬우니까 재밌다.


728x90

'프로그래밍 > Python' 카테고리의 다른 글

pygame 창 배경색 설정 surface fill  (0) 2022.12.04
Pygame 기본 화면 띄우기  (0) 2022.12.01
파이썬 이미지 채도 조절 :: Pillow - Color  (0) 2020.08.23
SciPy 설치  (0) 2017.08.31
Python 파일읽기  (0) 2017.08.09

댓글