Repository navigation
How to get Text from LocalizedText? #1274
Unanswered
FrictionalUnemployment
asked this question in
Q&A
Replies: 1 comment 1 reply
|
So I was able to solve it pretty quickly... Since self.client.get_node(i).get_display_name().dict returns {'Encoding': 2, '_text': 'Sensors', 'Locale': None, '_freeze': True} I was under the impression that the key value was 'Text'. Weird. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
So I'm trying to get the string value from key value "Text"
LocalizedText(Encoding:2, Locale:None, Text:Server) LocalizedText(Encoding:0, Locale:None, Text:None) LocalizedText(Encoding:2, Locale:None, Text:Sensors) LocalizedText(Encoding:2, Locale:None, Text:Sensors) LocalizedText(Encoding:2, Locale:None, Text:methods) LocalizedText(Encoding:2, Locale:None, Text:methods)This is the method I'm using:
self.client.get_node(i).get_display_name()
Unsure if there is a method or if I have to just split it manually to get the value, but it seems to be a dictionary so shouldn't be as hard as I'm making it out to be.
How do I get only "methods" from "Text" key? so that the output becomes "methods"
All reactions