How to grab keyboard command in Python 3.x ? I want to grab some keyboard command like ctrl+x , F9 etc in my program
How to grab keyboard command in Python 3.x ? I want to grab some keyboard command like ctrl+x , F9 etc in my program
I'm not sure what you mean.
If you mean when executing a python program at the command line, e.g.
a sample script would look like:Code:$python 23
where "sys.argv[1]" is the first argument passed to the command.Code:#!/usr/bin/python import sys import math i = float(sys.argv[1]) i = i/4 print i j = float(4)/7 print j
Is that what you mean?
no, I just want to capture keyboard command like ctrl+x in my program .example: If I press ctrl+x program do some job .
So you want to capture hotkeys? Like say ALT or CTRL+P sort?
You can check the pykeylogger.
http://pykeylogger.wiki.sourceforge.net/
Bookmarks