看板 PttEarnMoney 關於我們 聯絡資訊
※ 引述《DuBank (鍍銀)》之銘言: : 雙引號去不掉,該怎麼辦呢? : (語言應該是python2) : 最快幫我解決問題的微薄 1000p QQ : (最晚到明天早上10:00) : 題目網址: (需登入) : http://www.pyschools.com/quiz/view_question/s13-q8 隨便亂寫一下 def csvReader(filename): records = [] for line in open(filename): line = line.rstrip() # strip '\n' if line=='': continue # ignore empty line mode = 0 line_list = [] strr = '' for text in line: if text == '"': mode += 1 elif text == ',': if mode % 2 == 0: line_list.append(strr) strr = '' else: strr += text else: strr += text line_list.append(strr) records.append(line_list) return records 發1F -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 175.181.157.138 ※ 文章網址: https://www.ptt.cc/bbs/PttEarnMoney/M.1545153225.A.168.html
sherry86: 推 140.119.205.7 12/19 01:14
cwh0105: 推140.112.247.170 12/19 01:24
yuuna0000: 推125.231.117.224 12/19 01:54
DuBank: 好神奇(?) 謝謝幫忙!!已發P幣 118.171.152.4 12/19 06:37
ai241: 收到感謝!順便分享獎金給2,3F 210.68.225.233 12/19 09:36