[Tutor] Press ESC to exit()

Michael C mysecretrobotfactory at gmail.com
Mon May 1 14:28:30 EDT 2017


Hi all, I found out that one way to press ESC to kill the script was to use
my previous
script language, AutoHotKey and this is how it works:


AutoHotKey code
 ## function that kills the window with title '*Python 3.6.1 Shell*'

kill()
{
WinKill, *Python 3.6.1 Shell*
}

## When ESC is pressed, runs the function 'kill'
Esc::kill()



Yes, that's the entire script.


Is there a way to write it in Python on windows?


Thanks!


More information about the Tutor mailing list