用法:
class csv.Dialect
Dialect
類是一個容器類,其屬性包含有關如何處理雙引號、空格、分隔符等的信息。由於缺乏嚴格的 CSV 規範,不同的應用程序會產生細微不同的 CSV 數據。Dialect
實例定義reader
和writer
實例的行為方式。所有可用的
Dialect
名稱都由list_dialects()
返回,並且可以通過它們的初始化程序(__init__
)函數在特定的reader
和writer
類中注冊,如下所示:import csv with open('students.csv', 'w', newline='') as csvfile: writer = csv.writer(csvfile, dialect='unix') ^^^^^^^^^^^^^^
相關用法
- Python csv.DictWriter用法及代碼示例
- Python csv.DictReader用法及代碼示例
- Python csv.reader用法及代碼示例
- Python csv.writer用法及代碼示例
- Python cudf.core.column.string.StringMethods.is_vowel用法及代碼示例
- Python cudf.Series.ceil用法及代碼示例
- Python cudf.core.column.string.StringMethods.endswith用法及代碼示例
- Python cuxfilter.charts.datashader.heatmap用法及代碼示例
- Python cudf.Series.update用法及代碼示例
- Python calendar firstweekday()用法及代碼示例
- Python cusignal.windows.windows.hann用法及代碼示例
- Python cudf.DataFrame.mod用法及代碼示例
- Python cudf.DataFrame.isin用法及代碼示例
- Python cudf.core.column.string.StringMethods.title用法及代碼示例
- Python cuml.metrics.pairwise_distances.pairwise_distances用法及代碼示例
- Python collections.somenamedtuple._replace用法及代碼示例
- Python cuxfilter.charts.panel_widgets.int_slider用法及代碼示例
- Python cudf.DataFrame.rmul用法及代碼示例
- Python cudf.Series.max用法及代碼示例
- Python cmath.isclose()用法及代碼示例
注:本文由純淨天空篩選整理自python.org大神的英文原創作品 csv.Dialect。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。