Answer a question

Is there a way to send some parameter from autohotkey to python.

Using Autohot key I read some number from the notepad and store in a variable and now I want to send this number to the python code in order to do some calculations.

My Autohotkey code is:

controlGetText, telphoneNumber, Edit1, Untitled - Notepad

And I want to send this telphoneNumber to python file.

Is there a way I can do that?

Do I need to create an exe file of a python and then call from autohotkey? For example:

RunWait,  C:\Button\button.exe telphoneNumber

Or do I need to run command prompt commands from autohotkey to run python program? Something like:

Run Cmd Python  C:\Button\button.py telphoneNumber

I do not know which is the best way as I am newbie in Autohotkey.

Any suggestion will be appreciated.

EDIT:

However I succeded in sending parameter by using run command from autohotkey, which will execute the python file from command prompt.

Run Cmd \k "Python  C:\Button\button.py %telphoneNumber%"

But still want to know if this is the right solution, or if there are others?

Answers

The way you got it working is the easiest, and probably best, method of accomplishing what you want.

Communication between applications can be done with more methods then you probably can imagine, but as long as it doesn't have to be realtime you can call your programs with arguments, as it is easy and reliable.

Logo

Python社区为您提供最前沿的新闻资讯和知识内容

更多推荐