Open this example in the interactive library
Source code
import tomllib
config = tomllib.loads('[[tool]]\nname = "format"\n[[tool]]\nname = "check"')
print([tool['name'] for tool in config['tool']])Sample output
['format', 'check']

Open this example in the interactive library
import tomllib
config = tomllib.loads('[[tool]]\nname = "format"\n[[tool]]\nname = "check"')
print([tool['name'] for tool in config['tool']])['format', 'check']