Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Re: embed installed python dynamically

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


naveen.garg at gmail

Nov 25, 2009, 4:58 PM

Post #1 of 2 (204 views)
Permalink
Re: embed installed python dynamically

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


naveen.garg at gmail

Nov 25, 2009, 5:57 PM

Post #2 of 2 (179 views)
Permalink
Re: embed installed python dynamically [In reply to]

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

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.