Seite 1 von 1
Python25.dll Aufruf
Verfasst: Samstag 3. Oktober 2009, 22:15
von INFACT
Ich will python als .jar ausfürhren um das auf handys zu bekommen. Ich brauche dafür dll aufrufe von der python dll Bei mir klappt das aber nicht so ganz:
Code: Alles auswählen
import ctypes
python = ctypes.cdll.LoadLibrary("python25.dll")
python.Py_Initialize()
python.PyRun_SimpleString("import os")
python.Py_Finalize()
Wirft den Error:
Code: Alles auswählen
>>>
Traceback (most recent call last):
File "C:\python.py", line 5, in <module>
python.PyRun_SimpleString("import os")
WindowsError: exception: access violation reading 0x00000004
Warum klappt das nicht?
Re: Python25.dll Aufruf
Verfasst: Sonntag 4. Oktober 2009, 10:08
von HWK
INFACT hat geschrieben:Code: Alles auswählen
import ctypes
python = ctypes.cdll.LoadLibrary("python25.dll")
python.Py_Initialize()
python.PyRun_SimpleString("import os")
python.Py_Finalize()
Damit dieses Script läuft, muss doch der Python-Interpreter vorhanden sein. Warum führst Du dann "import os" nicht direkt aus? Für das, was Du vorhast, solltest Du vielleicht ein C-Programm schreiben. Vielleicht ist
das ja noch hilfreich. Evtl. wäre ja auch
Jython etwas für Dich.
MfG
HWK
Verfasst: Sonntag 4. Oktober 2009, 16:34
von Leonidas
Und was ``python25.dll`` auf dem Handy bewirken soll, ist auch völlig schleierhaft...
Verfasst: Sonntag 4. Oktober 2009, 18:49
von INFACT
Leonidas hat geschrieben:Und was ``python25.dll`` auf dem Handy bewirken soll, ist auch völlig schleierhaft...
Wenn ich mit java (nur java funktioniert auf meinem handy) auf die dll zugreifen kann, kann ich doch ein python ausführen oder nicht?
Verfasst: Sonntag 4. Oktober 2009, 18:50
von lunar
Und was verleitet Dich zu der Annahme, dass eine Windows-DLL auf dem Betriebssystem Deines Mobiltelefons so ohne weiteres läuft?
Verfasst: Montag 12. Oktober 2009, 13:20
von Mad-Marty
lunar hat geschrieben:Und was verleitet Dich zu der Annahme, dass eine Windows-DLL auf dem Betriebssystem Deines Mobiltelefons so ohne weiteres läuft?
Was dir Lunar durch die blume sagen will ist: "Vergiß es, anderes OS und CPU Architektur, befass dich mal mit der hardware".
