'How to prevent pyInstaller temporary files from being deleted?

I am creating an executable of Flask app by using pyinstaller. It allocates 10GB storage in the _MEIPASS folder under Temp directory. However, temporary files in _MEIPASS folder are removed when the program is terminated. It tooks long time to load all the files each startup. How can I prevent the pyinstaller temporary files from being deleted?



Sources

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

Source: Stack Overflow

Solution Source