自分用のまとめ
随時更新
自分がわかればいいからところどころ用語が間違ってるかも
!見方
#コマンド
#引数のオプションの説明
ConfigParserっていつ使うの?
設定ファイル(iniファイル)を扱うとき
モジュール読み込み
import ConfigParser #Python2
import configparser #Python2
頻出操作
こんなiniファイルがあったとする
[I]
name = taro
age = 40
#iniファイルの読み取り
ini = Configparser.SafeConfigParser()
ini.read()
#引数に読み取るiniファイルのパス
#要素の取得(taroの取得を例に)
#パターン1
name = ini.get['I']['name']
#パターン2
name = ini.get('I','name')