Python Forum

Full Version: pyahk autohotkey dll
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hey everybody,

I'm new to trying to write ahk in python and I'm trying to build my first script using autohotkey dll and the ahk module. When i try to load the script into autohotkey I get the above error. Here is the code:

ahk = cdll.AutoHotkey
keyboard = ahk
parser = ahk

------> ahk.key_press(ahk.key_press(^+c, print, ahk.key_press(f, {enter}))

ahk.key_press(^+z, print, ahk.key_pres(u, {enter}))

ahk.key_press(ahk.key_press(^+x, print, ahk.key_press(m, {enter}))

cmp_func = CMPFUNC(py_cmp_func)
fx = create_string_buffer(str(cast(cmp_func, c_void_p).value))

ahk.ahkdll(pyclient, "", fx)
ahk.ahkassign(create_string_buffer("fx"), fx)
ahk.addScript(script)
ahk.ahkFunction(create_string_buffer("fx2"), create_string_buffer("Untitled"))

I've fixed the errors and it doesn't throw an error but it won't launch in either python terminal or autohotkey. What am I missing? Thanks for your help.