• 1
  • 11
  • 12
  • 13
  • 14
  • 15(current)
Your 1st Add-On: Hello World!
(2020-03-13, 13:07)ronie Wrote: a bit of background info (reason for this change) can be found here: https://github.com/xbmc/xbmc/pull/3573

python:
line1 = "Hello World! We can write anything we want here Using Python"
xbmcgui.Dialog().ok(addonname, line1)

will work with kodi Matrix and all previous versions of kodi back to 2013.

I'm a little late to this, but if I try to pass information to the script in the form of variables in an external bash script, POSTed using a rpc call, all I get is the variables (not their values) in the pop-up box.
My relevant line in addon.py (Kodi Leia) is:
line1 = "sys.argv[2] sys.argv[3] now.strftime('%Y-%m-%d %H:%M')"

For what it's worth I'm passing CallerID Name, CallerID Number, Date to the addon like this:
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":1,"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.hello.world","params":["CallerID Name:     '"$CIDName"'","CallerID Number: '"$CIDNumber2"'","System Time Placeholder",""]}}' http://username:[email protected]:8080/jsonrpc

The CIDName and CIDNumber2 variables I get from mgetty.

I'm a newbie to python and would like to figure out how I pass multiple variables where I previosuly had:
line1 = sys.argv[1]
line2 = sys.argv[2]
line3 = now.strftime("%Y-%m-%d %H:%M")
xbmcgui.Dialog().ok(addonname, line1, line2, line3)

And that worked just fine ... thanks for any hlep







:
Reply
With some digging I found how to properly concatenate the variables to produce a desirable output:

line1 = sys.argv[2] + "\n" + sys.argv[3] + "\n" + now.strftime('%Y-%m-%d %H:%M')
I wanted the output on separate lines.
Reply
On the wiki page Built-in scripting steht:
Quote:For example,
     xbmc.executebuiltin('RunScript(script.myscript)')
will run the script myscript.py located in the Scripts directory.
Please expand the wiki page with the concrete path to this Scripts directory.
On my RPi4, I tried   /storage/.kodi/addons/test.py   but it doesn't work. Hmm ...

I started the RunScript(script.test) buildin with the Command add on, but the log file tell me only: ERROR: Not executing non-existing script script.test.
Reply
I downloaded Hello World addon zip and try install Kodi v.20.1.  I get  structure error. I change xbmc.version to 3.0.0 Bu again structure error while install the addon.  can not install Heello World addon to Kodi.
Reply
Hello @programmer 
I guess you are trying to install the addon as zipfile. If that fails you need to restart kodi before tying to install it again. If not, subsequent attempts will continue to fail (with the structure error), even if you've corrected the issue.
Quote:I change xbmc.version to 3.0.0
I'm not quite sure what you mean by that. You need to change the python version to 3.0.0 in addon.xml. That particluar line in addon.xml should look like this:
xml:
<import addon="xbmc.python" version="3.0.0"/>

I just tried hello world in kodi20.1 and worked after the change and restart of Kodi.
In the future, please provide a full debug log if you request assistance with errors. A log contains an enormous amount of useful information to those who are trying to help. Some info on how to create and add a log to your post can be found on Log_file (wiki)

Success!!
Reply
is the hello world addon still functional with on kodi 21? I tried dragging it to my addons folder but it doesn't show even after a reboot
Reply
  • 1
  • 11
  • 12
  • 13
  • 14
  • 15(current)

Logout Mark Read Team Forum Stats Members Help
Your 1st Add-On: Hello World!5