Python Forum
simple f-string expressions to access a dictionary - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: simple f-string expressions to access a dictionary (/thread-28343.html)



simple f-string expressions to access a dictionary - Skaperen - Jul-15-2020

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.