Dec-14-2020, 09:45 PM
Hi
With a lambda expression, it is possible to solve this issue without such oddities as nonlocal or global, nor without introducing in the xml(html) tree the value the tag's arguments are to be compared with.
Example :
With a lambda expression, it is possible to solve this issue without such oddities as nonlocal or global, nor without introducing in the xml(html) tree the value the tag's arguments are to be compared with.
Example :
# function to search for the tag def sel_laPage(article, atonique): return article.has_attr('α') and atonique >= article['α'] and atonique <= article['ω'] # function to set the value to be compared with the tag's arguments def contient(atonique): return lambda article : sel_laPage(article, atonique) #function to read the xml file and find the tag into it def test(fichier, atonique): grec=lire_xml(fichier) lapage=contient(atonique) return grec.find('body').find_all(lapage)Arbiel