使用工具:
使用语言:python3
virtkey: linux中使用Python模拟键盘按键
subprocess:
import virtkeyimport subprocessimport timesub = subprocess.Popen(['gnash', '-j', '1200', '-k', '1600', '--input-file', './201101_100.swf'])time.sleep(1) #等待flash加载时间v = virtkey.virtkey()v.press_keysym(65507)v.press_unicode(ord('o'))v.release_unicode(ord('o'))v.release_keysym(65507)time.sleep(1) #等待gnash截屏时间sub.terminate()