unittestの(22) - P2Pプロジェクトの戦闘(4)-read_config

 

4 read_config.py 

インポートのConfigParserの


クラスreadconfig:
    @staticmethod 
    DEF GET_CONFIG(FILE_PATH、sectionTop、オプション):
        CF 2 = configparser.ConfigParser()  インスタンス化オブジェクト 
        cf.read(FILE_PATH)  は、設定ファイル読み込み
        リターン CF2を[sectionTop ] [オプション]   #の戻りCI 


IF  __name__ == ' __main__ ' からツールをインポートPROJECT_PATHの
     印刷(ReadConfig.get_config(project_path.case_config_path、" MODE "" モード"))

 

おすすめ

転載: www.cnblogs.com/come202011/p/12232191.html