1

I have a python script copytimeinbuffer.py, and I need to run this with shift-f1 key. I used his script.

+F1::
Run "c:\bin\python27\python e:/copytimeinbuffer.py"
Send !{Space}ep
Return

However, I got this error message.

enter image description here

What's wrong with the script?

3
  • Somewhat unrelated note: Instead of sending !{Space}ep, you could use win32clipboard to read the clipboard contents. Sep 15, 2011 at 16:10
  • @grawity : I did that to emulate '^V' as is answered in superuser.com/questions/196631/… - it doesn't work though.
    – prosseek
    Sep 15, 2011 at 16:20
  • I know what !{Space}ep does. I also know that there are better ways to do the same thing than sending keypresses. Sep 15, 2011 at 16:26

2 Answers 2

2

Try removing the quotes from your Run argument. It could be that AHK is attempting to run a file named python e:/copytimeinbuffer.py, instead of just python. (The path to your .py file is a separate argument, and should not need to be quoted.)

3
  • Thanks for the answer. BTW, could you hint me why the print string in python isn't shown in the console? I asked about it in another post - superuser.com/questions/336509/…
    – prosseek
    Sep 16, 2011 at 19:14
  • 1
    if there is anyone who have understood what grawity is hinting at please tell, what is the actuall code that will make an interpreter run a .py file Aug 28, 2015 at 15:49
  • @user2673238 py -i file Jul 3, 2019 at 11:33
0

One thing what I found in running python script is that I needed to insert Sleep 100 before running the other AHK script.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .