how to enable this 'hello world' script ? [xbmc-live] - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: how to enable this 'hello world' script ? [xbmc-live] (/showthread.php?tid=101133) |
how to enable this 'hello world' script ? [xbmc-live] - schneidz - 2011-05-09 hi, i created this file: Code: xbmc@XBMCLive:~$ cat /live/image/dotXBMC/scripts/schneidz/schneidz.py nothing seems to work. can someone please direct me in the right direction as to how to run this program in xbmc ? thanks, - ronie - 2011-05-09 turn it into an addon. basically this means add an addon.xml file and put it in it's own folder in the addons directory. - schneidz - 2011-05-13 ^ thanks a lot ronie. i now have a zip file that looks like: Code: schneidz2.zip how can i get it to display the words 'hello world' on the screen ? edit: i see this: Code: xbmc@XBMCLive:~$ tail .xbmc/temp/xbmc.log - vikjon0 - 2011-05-13 Quote:still working on printing to the screen...You need to create a window. Check one of the working add-ons - cheeky - 2011-05-29 OP, check this wiki page for examples on some basic on-screen gui elements http://wiki.xbmc.org/index.php?title=HOW-TO_write_Python_Scripts_for_XBMC RE: how to enable this 'hello world' script ? [xbmc-live] - chadder1 - 2013-05-18 Try this: Code: # -*- coding: utf-8 -*- I am just learning too and figured this out just now. Note the special function "__init__ which, when included in a class, always runs when the class is called. The first line of this function tells python to create a ControlLabel (which is included in the xbmcgui library) with certain dimensions, font size and color. As far as I can tell, the second line adds this control to the window (basically telling it to draw the control on the window). And the third updates the "label" (i.e. the text) of this control to read "Hello World!" Hope this helps. Good luck with your coding. RE: how to enable this 'hello world' script ? [xbmc-live] - WelshPaul - 2013-05-18 Just to add my miniscule knowledge to Chadder1's I believe when you use the 'print' command that's just going to tell it to report the phrase 'hello world' in the log file but not on screen. While I'm learning python I use this a lot to check the correct things are being stored in my variables and functions, but to print things on screen in XBMC you need to use the correct interface commands that will be recognised by the xbmc and xbmcgui libraries, as Chadder1 does with the addControl and setLabel commands above. Others will correct me I'm sure if this is wrong. Good luck. RE: how to enable this 'hello world' script ? [xbmc-live] - Karnagious - 2013-05-18 All good stuff, really helpful for me as a student. But a 2-year old thread? RE: how to enable this 'hello world' script ? [xbmc-live] - WelshPaul - 2013-05-18 lol - didn't notce that!! RE: how to enable this 'hello world' script ? [xbmc-live] - Bstrdsmkr - 2013-05-18 Meh, it's good for people searching in the future RE: how to enable this 'hello world' script ? [xbmc-live] - chadder1 - 2013-05-20 And yet 4 replies in the last 2 days to my post.... I admit I didn't notice the date until after I posted but considering that this thread is one of the top google results for "xbmc python hello world" I figured that posting a working program is probably more helpful than "check one of the working add-ons." |