Created
January 31, 2016 18:52
-
-
Save dogrunjp/dbeeb3fd3e561ab0b228 to your computer and use it in GitHub Desktop.
メモリ上のCSVをリストに変換する方法。ファイルからCSVを読み込んだときのCSVと同様にcsv.rader()すると一文字ごとのリストが返ってしまうので、直接改行コードで区切りリストにする必用がある。urlopen()したcsvでも同様。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with BytesIO() as f: | |
ftp.retrbinary('RETR ' + filename, f.write) | |
data_list = f.getvalue().decode('utf-8').strip().split("\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment