DllCall doesn't support "Astr"
Issue #83
closed
My test library and example are below.
PyLib.ahk
PyInit() {
DllCall("LoadLibrary", "str", "python37.dll")
DllCall("python37.dll\Py_Initialize")
}
PyRun(pyStr) {
DllCall("python37.dll\PyRun_SimpleString", "Astr",pyStr)
}
PyDispose() {
DllCall("python37.dll\Py_Finalize")
}
PyRunFile(fileStr) {
DllCall("python37.dll\PyRun_SimpleString", "Astr", "exec(open(r'" . fileStr . "').read())" )
}
Test script for this library (pytest.ahk)
#Include "PyLib.ahk"
pystr := "print('hello world')"
PyInit()
PyRun(pystr)
PyDispose()
Probably need to run this from cmd.exe or Terminal and pipe to more, i.e.
>keysharp pytest.ahk | more
Comments (3)
-
reporter -
reporter - changed status to resolved
resolved
-
reporter - changed status to closed
closed
- Log in to comment
Works! Thank you! Closing.