How I could import new modules for my plugin???
#1
Hi all, I want to use some modules for my plugin but there is impossible to import new modules for me.
For example, I downloaded a Python module for process control called process.py ( http://code.google.com/p/python-process/ ) and I copyed process.py into the same folder of my script and in other paths of sys.paths but xbmc is not be able to import process.

I only copyed the file process.py into the paths and then, in my code I wrote:

Code:
import process

But xbmc log says me Error: "No module named process"

How I could import new modules for my plugin?

Thanks a lot.
Reply
#2
Now I have no errors with "No module named process", but I have this error in process module:

Code:
13:57:19 T:4176 M:2047332352  NOTICE: import process
13:57:19 T:4176 M:2047332352  NOTICE:   File "C:\Program Files (x86)\XBMC\scripts\Base De Datos\process.py", line 146, in ?
13:57:19 T:4176 M:2047324160  NOTICE: import win32api
13:57:19 T:4176 M:2047324160  NOTICE: ImportError
13:57:19 T:4176 M:2047324160  NOTICE: :
13:57:19 T:4176 M:2047324160  NOTICE: No module named win32api
13:57:19 T:4176 M:2047324160   ERROR: Scriptresult: Error

So, my problem is with an module named win32api ¿Where I could download the win32api.py for copy into my script folder?¿Is this the correct way to use it?

Thanks.
Reply
#3
The win32api seems to be mentioned here:

http://www.python.org/download/windows/
and
http://sourceforge.net/projects/pywin32/

It's a rather large library if that zip files size is anything to go by, and i doubt the code you would produce would be cross platform being dependent on win32 and all. Oo

Usually including the library's in the plugins folder structure is the way to go, at least until xbmc gets better python support (2.6 or higher would be really nice). If i remember correctly there are also some more common modules available through the add-ons structure if i remember correctly but i think that's outside the scope of what you're trying to do. Wink
Reply

Logout Mark Read Team Forum Stats Members Help
How I could import new modules for my plugin???0