Re: embed installed python dynamically

2009-11-25 Thread naveen
ok, it was almost intuitive.
just made a simple visual c express dll project
included python26\include and python26\libs in the project settings
the debug version has issues, but the release compiles without a
problem.
here is the source:
http://github.com/tinku99/embedpython
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: embed installed python dynamically

2009-11-25 Thread naveen
ok, its even easier than that.
With autohotkey:

pythondll := DllCall(LoadLibrary, str, c:\windows
\system32\python26.dll)
init := DllCall(c:\windows\system32\python26.dll\Py_Initialize
, Cdecl)
msgbox python initalized
call := DllCall(c:\windows\system32\python26.dll\PyRun_SimpleString
, str, import sys, Cdecl)
msgbox will exit using python code
call := DllCall(c:\windows\system32\python26.dll\PyRun_SimpleString
, str, sys.exit(0), Cdecl)
init := DllCall(c:\windows\system32\python26.dll\Py_Finalize
, Cdecl)
msgbox % never called
-- 
http://mail.python.org/mailman/listinfo/python-list