You can use the _**python-uinput**_ module to emulate the buttons in the Linux. [uinput github repo](https://github.com/tuomasjjrasanen/python-uinput) `pip install python-uinput` Нou can use such code to load the required module `media_controls = __import__('toggle_play_windows')`