0

Python code. How to pass parameters to JMESpath instead of hardcoding?

ext= '.md'
filtered_iterator = page_iterator.search("Contents[?ends_with(Key, `.md`)].Key") 

I would like to pass ext paramters in the contents path in the place of .md. What will be the possible way?

Sam Min Wong
  • 151
  • 3
  • 18

1 Answers1

1
ext= '.md'
filtered_iterator = page_iterator.search("Contents[?ends_with(Key, `%s`)].Key" % ext) 
helloV
  • 50,176
  • 7
  • 137
  • 145