2018년 10월 29일 월요일

파이썬으로 엑셀 다루기

엑셀을 다루는 라이브러리 인스톨
pip install openpyxl

1. 엑셀 활성화

from openpyxl import Workbook
wb = Workbook()
ws = wb.active

엑셀을 활성화 하고
시트를 활성화함



2. 폴더에서 파일 읽기

for file in os.listdir('경로') :
    if file.endswith('.txt') :
    f = open(file, 'rt', encoding='utf8')

경로에 있는 파일을 읽음
파일 중에 .txt로 끝나는 파일
파일을 읽음



3. 텍스트 파일에서 한줄씩 읽기

while True :
    line = f.readline()
    if not line : break



4. 읽은 값 엑셀에 작성

for i in 배열 :
ws['A'+str(c)]=i
c=c+1

wb.save('result.xlsx')



5. exe 파일로 배포

pyinstaller -F -n excel.exe excel_test.py












flutter 기본 개념 1

  Scaffold  - 화면 뼈대 역할  - 기본적으로 AppBar body floatingActionButton 같은걸 배치해줌  return Scaffold (       appBar : AppBar ( title : const Text ...