Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python keyboard input arrow keys

while True:
    key = cv2.waitKey(1) & 0xFF

    # if the 'ESC' key is pressed, Quit
    if key == 27:
        quit()
    if key == 0:
        print "up"
    elif key == 1:
        print "down"
    elif key == 2:
        print "left"
    elif key == 3:
        print "right"
    # 255 is what the console returns when there is no key press...
    elif key != 255:
        print(key)
Comment

PREVIOUS NEXT
Code Example
Python :: delete item from list python 
Python :: create Pandas Data Frame in Python 
Python :: numpy make 2d array 1d 
Python :: python get audio from video 
Python :: django loginview 
Python :: how to run a command in command prompt using python 
Python :: how to find python path 
Python :: join in pathlib path 
Python :: add list of dictionaries to pandas dataframe 
Python :: how delete element from list python 
Python :: function with args* example 
Python :: Read excel formula value python openpyxl 
Python :: python type hint list of specific values 
Python :: Adding new column to existing DataFrame in Pandas using assign method 
Python :: 2d array row and column 
Python :: DIVAB 
Python :: drop dataframe columns 
Python :: #find the difference in days between two dates. 
Python :: Math Module degrees() Function in python 
Python :: python save plot 
Python :: render to response django 
Python :: regular expression syntax python 
Python :: python function parameters default value 
Python :: ttktheme example 
Python :: python is scripting language or programming language 
Python :: dict ;get a key of a value 
Python :: subplot ytick percent 
Python :: python puissance 
Python :: print type on each cell in column pandas 
Python :: python cant find keras utils to_categorical 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =