Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

PAHK - Python package to extend python with autohotkey

  • Please log in to reply
5 replies to this topic
  • Members
  • 1 posts
  • Last active: Jan 14 2013 10:32 PM
  • Joined: 11 Jan 2013


PAHK make possible the use of .ahk (autohotkey script) script within python in a fully threaded way. It also let python interact with the script at runtime. You might find it most useful for task involving macro,hotkeys or windows functions (such as getclipboard data).

Everything that you need to know his on the project page above.
Look at the wiki to get a very complete overview of the methods

Here's one picture for the insecure:


How to install a python package:
1: Unpack the version you downloaded in a folder
2: Create a new .bat file in the folder
3:Write this inside it "C:\PythonXX\python.exe setup.py install" where PythonXX is you python directory (ex: Python27).
4:Execute the bat


  • Members
  • 70 posts
  • Last active: Feb 01 2017 01:55 PM
  • Joined: 18 Sep 2006

That sounds useful!1

No one else interested?!


I'm currently writing something Autohotkey and Python related... Using Python only for the interface.


What is your usecase dberube4?

have more examples?

  • Members
  • 20 posts
  • Last active: Feb 18 2018 08:54 AM
  • Joined: 25 Dec 2012

Thank you so much for this awesome piece of work!!!


I found it and one minute after I was running my ahk scripts from python, its so amazing, I really dont understand how no one else commented or thanked, thanks again!!

  • Members
  • 2 posts
  • Last active: Mar 05 2014 05:47 PM
  • Joined: 22 Feb 2014

I hate to resurrect older threads, but I'm having trouble turning up information... I am running into an error after following all the above steps to install everything into the Python27 directory.  I confirmed the files wrote to: C:\Python27\Lib\site-packages

I'm currently running Python 2.7.6.

Traceback (most recent call last):
  File "C:\Users\blahblah\Desktop\tester.py", line 7, in <module>
  File "C:\Python27\lib\site-packages\pahk.py", line 66, in execute_script
    _execute_script = self.ahk_dll.ahktextdll
AttributeError: Interpreter instance has no attribute 'ahk_dll'

The code I'm attempting to run is literally what is linked in the initial post's image.


Did anyone else run into anything like this?


Thanks in advance!

  • Members
  • 1216 posts
  • Last active: Oct 30 2015 05:12 PM
  • Joined: 27 Oct 2012

In this regard, I would like to present you with this:


  • Members
  • 2 posts
  • Last active: Mar 05 2014 05:47 PM
  • Joined: 22 Feb 2014

Thank you for the response, I ended up going a different route since I couldn't solve the PAHK implementation specifically.  Much appreciated though!