Embedding Python in AHK

Get help with using AutoHotkey and its commands and hotkeys
bourdin07
Posts: 33
Joined: 23 Jun 2019, 12:57

Embedding Python in AHK

14 Mar 2020, 10:47

Hello I found this in the old forum:
https://autohotkey.com/board/topic/47595-embed-python/

It said to run a .py script to register the COM object
c:\python27\lib\site-packages\win32com\servers\interp.py
and then in .ahk script

Code: Select all

i := python := ComObjCreate("Python.Interpreter")
i.Exec("import win32api")
r :=  i.Eval("win32api.GetComputerName()")
msgbox % r
But the problem I use Python 3.8.
I executed the .py script to register the COM located :
C:\Program Files\Python38\Lib\site-packages\win32com\servers\interp.py
But the AHK script doesn't work. The COM object is not found.

Anyone, have an idea ?

Return to “Ask For Help”

Who is online

Users browsing this forum: AHKStudent, anv, artur1884, blackjoker, Google [Bot], hasantr, mankvl, submeg and 47 guests