Python Forum

Full Version: simple f-string expressions to access a dictionary
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
did anyone ever figure out a way to have a run time generated sting value processed like a f-string in the local context? i asked about this many moons ago when i had a need for it. now i have another need which is more complex. the string is like an f-string with simple expressions like {foo} which will be modified to change these expressions to be like {myvariables["""foo"""]}. maybe i can refactor this to be simpler if that problem is solved.