Author(s): Rebecca Vandewalle
This contains educational materials for a demo for the Nobel Project.
(for viewing purpose only)
commented on November 22, 2020 at 11:19 am
thanks for this page. I spent a lot of time before finding a clear and helpful explanation of how to add a text via folium.
The problem I have now : I want to add a python string by name, a variable, not a ‘constant’ string. Like for example ” a = ‘sss'” : I want to put “a”, not “sss” in the HTML text.
Is it possible ?
commented on November 23, 2020 at 10:54 am
You could use something like the following to store your variable name as a text string to be able to use in the HTML. However, this is clunky and it is often better to simply type “a” directly into the HTML, or figure out a way to store the information you need as the variable data not the variable name.
a = “sss”
variable_name = [k for k, v in locals().items() if v == “sss”]
Code from: https://www.codespeedy.com/get-a-variable-name-as-a-string-in-python/
commented on January 27, 2021 at 10:38 pm
This article is very helpful and grateful. Thank you for sharing awesome article.
Name and email are required. Your email will not be published.