Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
    
Somewhat unrelated note: Instead of sending !{Space}ep, you could use win32clipboard to read the clipboard contents. – grawity Sep 15 '11 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 '11 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. – grawity Sep 15 '11 at 16:26
up vote 1 down vote accepted

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.)

share|improve this answer
    
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 '11 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 – user2673238 Aug 28 '15 at 15:49

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

share|improve this answer

You must log in to answer this question.

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