PyWin32 - Python extension for using Win32 API

PyWin32 is a library of Python extensions for Windows that enables you to use the features of the Win32 application programming interface (API) on Python.


Install PyWin32

pip install pywin32

First, install PyWin32 through the command above on the command prompt.


Basic usage - Beep()

Beep() method in the win32api module makes simple sounds.

import win32api

win32api.Beep(500, 3000)

Enter frequency in the 37-32,767 Hz range for the first parameter of the Beep() , and duration time in ms for the second parameter.

The code generates a tone of 500 Hz for 3000 ms.


Next