keypress_demo.py
来自「非原创。很好的python例子」· Python 代码 · 共 22 行
PY
22 行
#!/usr/bin/env python"""Show how to connect to keypress eventsNote, on the wx backend on some platforms (eg linux), you have tofirst click on the figure before the keypress events are activated.If you know how to fix this, please email us!"""from pylab import *def press(event): print 'press', event.key if event.key=='g': grid() draw() connect('key_press_event', press)title('press g to toggle grid')plot(rand(12), rand(12), 'go')show()
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?