Я пытаюсь прочитать файл JSON, который включает Python переменные, которые должны отображаться как значение переменной, а не как сама переменная.
with open('path_to_file.json') as f:
my_json = json.load(f)
json_variable = my_json['text']
# The example text in the json file is:
# Hello, I want to be there in {defined_days} days
defined_days = 3
# What I tried, but doesn't work
interpolated_text = f'{json_variable}'
# Output of interpolated_text:
# Hello, I want to be there in {defined_days} days
Показывает Строка из файла json, но fined_days не будет заменена на число 3 .