Skip to content

Instantly share code, notes, and snippets.

View zhenalexfan's full-sized avatar
💩

Zhen Fan zhenalexfan

💩
View GitHub Profile
@zhenalexfan
zhenalexfan / add_contact_pinyin.py
Created September 3, 2019 07:24
Batch add phonetic names to your Chinese contacts
import csv
from pypinyin import pinyin, lazy_pinyin, Style
def cn_char(text):
return all('\u4e00' <= char <= '\u9fff' for char in text)
if __name__ == '__main__':
data =[]
with open('contacts.csv', encoding='utf-8') as f: