Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not work #2

Open
superuser7777 opened this issue Nov 13, 2024 · 2 comments
Open

not work #2

superuser7777 opened this issue Nov 13, 2024 · 2 comments

Comments

@superuser7777
Copy link

superuser7777 commented Nov 13, 2024

I configured it according to the readme, but it didn't work.
Both example1 and 2 have the same error.
Is there a setting I'm overlooking?

ImportError                               Traceback (most recent call last)
X:\temp/ipykernel_24620/1116311586.py in <module>
----> 1 from pyahk import MouseGetPos, mul
      2 from pyahk import *
      3 
      4 AhkApi.initialize()  # init ahk
      5 AhkApi.addScript('''

ImportError: cannot import name 'MouseGetPos' from 'pyahk' (d:\SOFT\dev\_runtime\_python\Winpython310\python-3.10.0.amd64\lib\site-packages\pyahk\__init__.py)
ImportError                               Traceback (most recent call last)
X:\temp/ipykernel_24620/154558150.py in <module>
----> 1 from pyahk import Gui, MsgBox, FileAppend, Array, Map, JSON, Hotkey, HotIf, WinActive
      2 from ctypes import c_wchar_p
      3 from pyahk import *
      4 
      5 AhkApi.initialize()  # init ahk

ImportError: cannot import name 'Gui' from 'pyahk' (d:\SOFT\dev\_runtime\_python\Winpython310\python-3.10.0.amd64\lib\site-packages\pyahk\__init__.py)

btw, the URL of "Download ZIP" is VSCode lsp.

@thqby
Copy link
Owner

thqby commented Nov 13, 2024

Before importing variables, you need to initialize the ahk.

Move the first line after the fifth line.

@superuser7777
Copy link
Author

It worked fine.
Thank you for the wonderful library.
Imgur Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants