Run script on Python installed in Windows
#1
Hi. I want run script on Python installed in Windows (C:\Python27\)

In XBMC I run script:
Code:
# -*- coding: utf-8 -*-

import os
import sys
import subprocess

try:
    pin = int(sys.argv[1])
except:
    pin = 10

if 0 <= pin <= 7:
    print pin
    subprocess.call('c:\lpt.bat')

lpt.bat:
Code:
python c:\lpt.py
pause

But I get error:

Code:
M:\XBMC>python c:\lpt.py
Traceback (most recent call last):
  File "c:\lpt.py", line 3, in <module>
    from ctypes import windll
  File "M:\XBMC\system\python\Lib\ctypes\__init__.py", line 10, in <module>
    from _ctypes import Union, Structure, Array
ImportError: DLL load failed: %1 nie jest prawid│ow╣ aplikacj╣ systemu Win32.

It seems that the script run from XBMC Python.
Reply
#2
If I runmanually lpt.bat script work fine.
I added to script lpt.py:

Code:
print os.environ['PYTHONPATH'].split(os.pathsep)

result show path to XBMC:

Code:
['M:\\XBMC\\system\\python\\DLLs', 'M:\\XBMC\\system\\python\\Lib']
Reply

Logout Mark Read Team Forum Stats Members Help
Run script on Python installed in Windows0