'How to prevent Pyinstaller from extracting files in Temp

I am using an executable file generated with Pyinstaller from my Python script.

Every time I open it, it creates a folder named (for example) _MEI12345 in \AppData\Local\Temp.

How can I prevent the creation of that folder? Are there other (better) ways to create an executable file if I have to distribute it?



Sources

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

Source: Stack Overflow

Solution Source