When the Mac (or MacBook) is running for a long time, it is very liable to do one of the following things:
- screen saver
- lock screen
The problem is that your Python program or R program running in the background will most likely stop completely. Sure, it can resume when you activate the Mac again, but that is not what most people want! For one, it may impact the accurate calculation of elapsed time of your Python code.
Changing settings via System Preferences -> Energy Saver is a possible solution, but it is troublesome and problematic:
- Have to switch it on and off again when not in use (many steps).
- Preventing sleep may still run into screen saver, screen lock, etc.
- Vice versa, preventing screen lock may still run into Mac sleeping, etc.
The solution is to install this free App called Amphetamine. Despite its “drug” name, it is a totally legitimate program that has high reviews everywhere. What this app does is to prevent your Mac from stopping, locking or sleeping. Hence, whatever program you are running will not halt till the program is done (or when you switch off Amphetamine).
It is a great program that does its job well! Highly recommended for anyone doing programming, video editing or downloading large files on Mac.