Somewhat beginner python plugin question (about sys.argv)
#1
I'm toying around with writing a plugin for CTV. I've read thru the wiki article on how to create plugins and it seems fairly straight forward, but I'm stuck on something that's probably really easy for someone who's done this for a while.

Most of the examples on the wiki as well as documentation about the xbmcplugin module use the sys.argv variable (I'm coming from the C++ world, so my terms might be slightly off possibly). However, according to this post (http://forum.xbmc.org/showthread.php?tid...t=sys.argv) sys.argv doesn't exist unless you start the script a specific way. I'm running XBMC with Aeon skin and I'm trying to start the script I'm working on from the Script menu item, which seems to be the way that doesn't provide me with a sys.argv variable and therefore my script keeps failing (or more correctly, the example script from the wiki).

So my question is how do I go about getting the sys.argv variable being available in my script or alternatively, what do I supply as the handle to the xbmcplugin.addDirectoryItem function if I don't use the sys.argv[1] variable?

Thanks,
Harry
Reply
#2
I should probably delete my original post cause it's quite silly the mistake I've made ... but in case anyone else does what I just did I'll leave it for the benefit of others. My problem is that I'm writing a plugin and starting it from the scripts menu ... not gonna work that way. You have to start it as a plugin ... oops.

Harry
Reply
#3
it happends to all of us at least one time lol Wink
Reply

Logout Mark Read Team Forum Stats Members Help
Somewhat beginner python plugin question (about sys.argv)0