Python을 공부하던 중에 파일 IO에서 
    dialect = ~ 
라는 형태의 파라미터가 있었다.

이 포스트는 dialect가 뭔가 싶어서 찾아본 결과이다.

"요약"

dialect: 방언(方言)

명사

1.언어학

각 지방의 언어 체계. 표준어는 서울 방언을 토대로 하여 이루어진 것임.

2.언어학

특히, 표준어와 다른 각 지방의 언어 체계나 개별적 단어.

"경상도 ∼"

3.언어학

한 언어에서, 사회 계층에 따라 다른 언어 체계.

4.크리스트교 성서

성령을 받은 신자가 황홀 상태에서 말하는 내용 불명의 말.

입출력 형식을 쉽게 지정할 수 있도록 데이터에 포함된 특정 형식의 매개 변수가 파이썬에서도 동일하게 사용되게 만드는 매개 변수이다.



일단 document를 확인해보자.
https://docs.python.org/2/library/csv.html#dialects-and-formatting-parameters

"
To make it easier to specify the format of input and output records, specific formatting parameters are grouped together into dialects. A dialect is a subclass of the 
Dialect class having a set of specific methods and a single validate() method. When creating reader or writer objects, the programmer can specify a string or a subclass of the Dialect class as the dialect parameter. In addition to, or instead of, the dialect parameter, the programmer can also specify individual formatting parameters, which have the same names as the attributes defined below for the Dialectclass.
입출력 레코드의 형식을보다 쉽게 ​​지정할 수 있도록 특정 서식 매개 변수가 함께 방언으로 그룹화됩니다. Dialect는 Dialect 클래스의 하위 클래스이며 특정 메서드 집합과 단일 validate () 메서드를 포함합니다. 프로그래머는 reader 또는 writer 객체를 만들 때 Dialect 클래스의 문자열 또는 하위 클래스를 dialect 매개 변수로 지정할 수 있습니다. dialect 매개 변수에 추가하여, 또는 대신에 프로그래머는 Dialect 클래스에 대해 아래에 정의 된 속성과 동일한 이름을 가진 개별 형식 매개 변수를 지정할 수 있습니다.
"
"
Dialects support the following attributes:
Dialect.delimiter
A one-character string used to separate fields. It defaults to ','.
Dialect.doublequote
Controls how instances of quotechar appearing inside a field should themselves be quoted. When True, the character is doubled. WhenFalse, the escapechar is used as a prefix to the quotechar. It defaults to True.
On output, if doublequote is False and no escapechar is set, Error is raised if a quotechar is found in a field.
Dialect.escapechar
A one-character string used by the writer to escape the delimiter if quoting is set to QUOTE_NONE and the quotechar if doublequote is False. On reading, the escapechar removes any special meaning from the following character. It defaults to None, which disables escaping.
Dialect.lineterminator
The string used to terminate lines produced by the writer. It defaults to '\r\n'.
Note
 The reader is hard-coded to recognise either '\r' or '\n' as end-of-line, and ignores lineterminator. This behavior may change in the future.
Dialect.quotechar
A one-character string used to quote fields containing special characters, such as the delimiter or quotechar, or which contain new-line characters. It defaults to '"'.
Dialect.quoting
Controls when quotes should be generated by the writer and recognised by the reader. It can take on any of the QUOTE_* constants (see section Module Contents) and defaults to QUOTE_MINIMAL.
Dialect.skipinitialspace
When True, whitespace immediately following the delimiter is ignored. The default is False.
Dialect.strict
When True, raise exception Error on bad CSV input. The default is False.
사투리는 다음 속성을 지원합니다. 

Dialect.delimiter 
필드를 구분하는 데 사용되는 한 문자로 된 문자열입니다. 기본값은 ','입니다. 

Dialect.doublequote 
필드 안에 나타나는 quotechar의 인스턴스를 따옴표로 묶어야하는 방법을 제어합니다. True이면 캐릭터가 두 배가됩니다. False 일 경우 이스케이프 문자는 quotechar의 접두사로 사용됩니다. 기본값은 True입니다. 

출력시 doublequote가 False이고 escapechar이 설정되지 않은 경우 필드에 quotechar이 있으면 Error가 발생합니다. 

Dialect.escapechar 
따옴표가있는 경우 구분 기호에서 이스케이프하기 위해 작성자가 사용하는 한 문자 문자열을 QUOTE_NONE으로 설정하고 doublequote가 False 인 경우 quotechar을 설정합니다. 독서에서, escapechar는 뒤에 오는 특성에서 어떤 특별한 의미든지 제거한다. 기본값은 없음으로, 이스 케이 핑을 비활성화합니다. 

Dialect.lineterminator 
작성자가 작성한 행을 종료하는 데 사용되는 문자열. 기본값은 '\ r \ n'입니다. 

참고 판독기는 '\ r'또는 '\ n'을 행의 끝으로 인식하도록 하드 코드되며 선형 결정자는 무시됩니다. 이 동작은 앞으로 변경 될 수 있습니다. 
Dialect.quotechar 
구분 기호 또는 quotechar과 같은 특수 문자를 포함하는 필드를 인용하는 데 사용되는 한 문자 스트링 또는 개행 문자를 포함하는 문자열. 기본값은 '' '입니다. 

Dialect.quoting 
따옴표가 작성자에 의해 생성되고 독자가 인식해야하는시기를 제어합니다. QUOTE_ * 상수 (모듈 내용 절 참고)를 사용할 수 있으며 기본값은 QUOTE_MINIMAL입니다. 

Dialect.skipinitialspace 
True이면 구분 기호 바로 다음의 공백이 무시됩니다. 기본값은 False입니다. 

방언. 엄격 
True이면 잘못된 CSV 입력시 예외 오류가 발생합니다. 기본값은 False입니다.
"


위의 document를 읽어보면 어떤 형식의 파일이 지원되는지 찾아보자,
csv.Dialect : 
csv.excel(Excel 출력의 CSV파일), csv.excel_tab(TSV파일), csv.Sniffer(일반 CSV)
라는 것을 알아내었다.
https://docs.python.org/2/library/csv.html#csv.Dialect

+ Recent posts