'Is it possible to build a Windows .exe or Mac .dmg from a Linux only system? [duplicate]

I wrote a small encryption application in Python. Using PyInstaller, I created an executable Linux file that runs the application without the need to have Python installed. Now, I am trying to create an executable from the same Python file for Windows and Mac. Is it possible to do this from the same Linux OS I am running or do I need a Windows and Mac (virtual) machine?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source