0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

python csvの中身を外部ライブラリなしで取り出す -openpyxl無し,csv無し-

Posted at

csvの中身を簡単に取り出す

f = open("商品データ.csv", "r", encoding="utf-8-sig") #CSVを開く
r = f.readlines() #中身を変数に代入
f.close() #CSVを閉じる
dat = []
for i in r:
    s = i.replace("\n", "") #ウィンドウズは¥n 改行を置換で削除
    dat.append(s.split(","))
print(dat)

スクリーンショット 2022-07-11 19.05.39.png
スクリーンショット 2022-07-11 19.04.51.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?