Python Forum
simple f-string expressions to access a dictionary
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
simple f-string expressions to access a dictionary
#1
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.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Use or raw string on regular expressions Zaya_pool 5 334 May-09-2024, 06:10 PM
Last Post: Zaya_pool
  Converting '1a2b3c' string to Dictionary PythonNoobLvl1 6 1,936 May-13-2022, 03:44 PM
Last Post: deanhystad
  Simple syntax to asynchronously get access to MODBUS register orion67 1 2,918 Jan-22-2022, 12:40 PM
Last Post: orion67
  Beautify dictionary without converting to string. sharoon 6 3,472 Apr-11-2021, 08:32 AM
Last Post: buran
  extract a dictionary from a string berc 4 2,926 Jul-30-2020, 06:58 AM
Last Post: berc
  access dictionary with keys from another and write values to list redminote4dd 6 3,333 Jun-03-2020, 05:20 PM
Last Post: DeaD_EyE
  problem coverting string data file to dictionary AKNL 22 6,617 Mar-10-2020, 01:27 PM
Last Post: AKNL
  Simple newb string question Involute 2 2,287 Sep-08-2019, 12:50 AM
Last Post: Involute
  simple string & input problem kungshamji 5 3,737 Jun-23-2019, 03:54 PM
Last Post: kungshamji
  Trouble converting JSON String to Dictionary RBeck22 7 5,268 Mar-28-2019, 12:12 PM
Last Post: RBeck22

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020