Skip to content

Instantly share code, notes, and snippets.

@TomoG29
Last active October 31, 2023 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TomoG29/4a49d41650fc58ee4103d7ae55092c92 to your computer and use it in GitHub Desktop.
Save TomoG29/4a49d41650fc58ee4103d7ae55092c92 to your computer and use it in GitHub Desktop.
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