For some quick context, I was trying to make a game where you essentially would press a key and control how a symbol moves around a 2d array, however when trying to use the keyboard
module in python, I get this error,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/Quartz/__init__.py", line 6, in <module> import AppKit File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/AppKit/__init__.py", line 10, in <module> import Foundation ModuleNotFoundError: No module named 'Foundation'
import random
import keyboard
board = [
["*","*","*","*","*","*","*","*","*"],
["*","*","*","*","*","*","*","*","*"],
["*","*","*","*","*","*","*","*","*"],
["*","*","*","*","*","*","*","*","*"],
["*","*","*","*","*","*","*","*","*"],
["*","*","*","*","*","*","*","*","*"],
["*","*","*","*","*","*","*","*","*"],
["*","*","*","*","*","*","*","*","*"],
["*","*","*","*","*","*","*","*","-"],
]
def move_handle():
while True:
try:
if keyboard.is_pressed(37):
print('You Pressed A Key!')
elif keyboard.is_pressed(38):
print("you pressed a key")
elif keyboard.is_pressed(39):
print("you pressed a key ")
elif keyboard.is_pressed(40):
print("you pressed a key")
except:
pass
move_handle(board)