Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python处理keyPressed()函数不工作_Python_Processing - Fatal编程技术网

python处理keyPressed()函数不工作

python处理keyPressed()函数不工作,python,processing,Python,Processing,这是我的代码中不起作用的一部分 我是在用python处理3时做的如果你想从上一个问题()开始进度条,当按下w时,你必须添加一个状态(start\u progress)。设置按键时的状态(start\u progress=True),并根据状态运行fill\u rect: 从时间导入睡眠 def fill_rect(): 全局填充、填充、矩形填充、速度填充 填充(填充r,填充v,0) 矩形(宽度/2-100,高度/2-12.5,矩形x,25) 如果rect_x如果要从上一个问题()开始进度条,则当

这是我的代码中不起作用的一部分
我是在用python处理3时做的如果你想从上一个问题()开始进度条,当按下w时,你必须添加一个状态(
start\u progress
)。设置按键时的状态(
start\u progress=True
),并根据状态运行
fill\u rect

从时间导入睡眠
def fill_rect():
全局填充、填充、矩形填充、速度填充
填充(填充r,填充v,0)
矩形(宽度/2-100,高度/2-12.5,矩形x,25)

如果rect_x如果要从上一个问题()开始进度条,则当按w时,必须添加状态(
start_progress
)。设置按键时的状态(
start\u progress=True
),并根据状态运行
fill\u rect

从时间导入睡眠
def fill_rect():
全局填充、填充、矩形填充、速度填充
填充(填充r,填充v,0)
矩形(宽度/2-100,高度/2-12.5,矩形x,25)
if rect_x
def keyPressed():
    global fill_r
    global fill_v
    global rect_x
    if key == 'W' or key == 'w':
        fill_rect() 
        print("TEST")