Last active
October 31, 2023 11:17
-
-
Save TomoG29/4a49d41650fc58ee4103d7ae55092c92 to your computer and use it in GitHub Desktop.
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
import TomoGBlog.settings as tomog | |
################# 1 ################ | |
from importlib import reload | |
tomog = reload(tomog) | |
###################################### | |
################# 2 ################ | |
#セクションキーを指定 | |
section_key = 5 | |
#オプションキーを定義 | |
OPTION_KEY_A = "A" | |
OPTION_KEY_B = "B" | |
###################################### | |
################# 3 ################ | |
# キーに対応する値を取得 | |
config = tomog.init(section_key) | |
val1 = config[OPTION_KEY_A] | |
val2 = config[OPTION_KEY_B] | |
###################################### | |
print(f"{OPTION_KEY_A}:{val1}, {OPTION_KEY_B}:{val2}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment