파이썬2 python으로 csv파일 처리하기(기본) CSV - 필드들이 쉼표(,)로 구분된 파일 CSV 파일 읽기/쓰기 - with open("mycsv.csv") as csv_data_read: - with open("mycsv.csv", "r") as csv_data_read: - with open("mycsv.csv", "w") as csv_data_write: - with open(("mycsv.csv", "a") as csv_data_append: - r : read - w : write - a : append 함수 한줄씩 readline() 전체 read() ---> return string 전체 readlines() ---> return list CSV 객체 - 쉼표(,)로 구분된 파일 중 필드내용에 ,가 들어가 있는경우에 대한 전처리 과정이.. 2020. 3. 2. Difference pass vs continue in Python for book in books: if not book: pass print("pass") for book in books: if not book: continue print("continue") pass : pass라고 쓰여 있는 부분에 단지 실행할 코드가 없다는 뜻이다. 그러므로 print("pass")가 실행된다. continue : continue를 만나면 다음순번의 loop를 돌라는 뜻이다. 그러므로 pass와 다르게 print("continue")가 실행되지 않는다. 2020. 1. 21. 이전 1 다음