Posts: 81
Joined: Nov 2009
Reputation:
3
2010-01-22, 18:44
Hi guys
How do I get the content of a string back to a window?
I can see the string through the script, but I want the output to appear in a lavel.
Something like:
<label2>$INFO[Skin.String(STRING)]</label2>
Kind regards
cyber7
Posts: 2,710
Joined: Feb 2009
Reputation:
12
ppic
Skilled Python Coder
Posts: 2,710
how can we help you with so few informations?
what's the code?
what are you trying to do?
where do you want to show ?
what have you done so far?
...
Posts: 81
Joined: Nov 2009
Reputation:
3
2010-01-23, 08:52
(This post was last modified: 2010-01-23, 09:00 by cyber7.)
Sorry if the info is missing,
What I do is: Run a script uising:
python script.py
It displays the result, ie:
Your answer is: AUBREY
The code is at work, so I can't give the exact details, but as far as I can remember, it looks like:
STRING = (and the function)
What I would like to do is not display the string in the program, but return it into XBMC's windows with, as I said in my previous post:
<label2>$INFO[Skin.String(STRING)]</label2>
so that the contents of STRING is displayed in <label2>
Hope this is more clear
cheers
cyber7
ps - I see from the link in the previous post that:
Methods defined here:
getLabel(...)
getLabel() -- Returns the text value for this label.
example:
- label = self.label.getLabel()
setLabel(...)
setLabel(label) -- Set's text for this label.
label : string or unicode - text string.
example:
- self.label.setLabel('Status')
Does this mean that I can (after STRING has been assigned) do the following in python:
self.label.setLabel('STRING')
and then in my window code do:
<label2>$INFO[Skin.String(STRING)]</label2>
which means that label2 will display AUBREY?
Posts: 81
Joined: Nov 2009
Reputation:
3
I do understand that, but I can not find a:
self.strActionInfo.setString(STRING)
option to set the string in the python script to return to the window...
or am I sitting the pot miss?
Posts: 124
Joined: May 2009
Reputation:
1
You should post some relevant code from your skin file and your python script. It looks like you misunderstand the concept here
Posts: 2,710
Joined: Feb 2009
Reputation:
12
ppic
Skilled Python Coder
Posts: 2,710
could you post your xml too ?
and your class code?
Posts: 81
Joined: Nov 2009
Reputation:
3
Basically the XML looks like this:
<item id="1">
<label>test</label>
<onclick>RunScript(special://skin/scripts/ipsetting.py)</onclick>)
<label2>CURRENT IP ADDRESS: $INFO[Skin.String(IPADD)]</label2>
</item>
It is the CURRENT IP ADDRESS: information that I would like to keep updated...
Kind regards
cyber7