Kodi Community Forum

Full Version: Problem with own Python Scripts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The following code doesn't work:
Code:
import sys, xbmc
#print xbmc.executeJSONRPC(sys.argv[1])
help(xbmc)

tag = xbmc.Player().getMusicInfoTag()
artist = tag.getArtist()
title = tag.getTitle()
print "Playing: " + artist + " - " + title



Code:
root ~/downloads/myaddon # python test.py
Help on package xbmc:

NAME
xbmc

FILE
/usr/lib/python2.7/site-packages/xbmc/__init__.py

DESCRIPTION
# -*- coding: utf-8 -*-
# File intentionally left blank

PACKAGE CONTENTS
bt (package)
ps3 (package)
xbmcclient
zeroconf


Traceback (most recent call last):
File "test.py", line 5, in <module>
tag = xbmc.Player().getMusicInfoTag()
AttributeError: 'module' object has no attribute 'Player'


Any Ideas?
you cannot import modules outside XBMC