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
  Converting '1a2b3c' string to Dictionary PythonNoobLvl1 6 734 May-13-2022, 03:44 PM
Last Post: deanhystad
  Simple syntax to asynchronously get access to MODBUS register orion67 1 976 Jan-22-2022, 12:40 PM
Last Post: orion67
  Beautify dictionary without converting to string. sharoon 6 2,053 Apr-11-2021, 08:32 AM
Last Post: buran
  Statements and Expressions Julie 1 1,013 Feb-26-2021, 05:19 PM
Last Post: nilamo
  Regular Expressions pprod 4 2,059 Nov-13-2020, 07:45 AM
Last Post: pprod
  extract a dictionary from a string berc 4 1,824 Jul-30-2020, 06:58 AM
Last Post: berc
  access dictionary with keys from another and write values to list redminote4dd 6 2,149 Jun-03-2020, 05:20 PM
Last Post: DeaD_EyE
  problem coverting string data file to dictionary AKNL 22 4,063 Mar-10-2020, 01:27 PM
Last Post: AKNL
  Simple newb string question Involute 2 1,533 Sep-08-2019, 12:50 AM
Last Post: Involute
  simple string & input problem kungshamji 5 2,440 Jun-23-2019, 03:54 PM
Last Post: kungshamji

Forum Jump:

User Panel Messages

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