This recipe is prepared exclusively for a Linux box. There are some Python modules specially designed to bring similar functionalities on Windows and macOS platforms. For example, see http://sourceforge.net/projects/pywin32/ for Windows-specific implementation.