I'm writing a program to wake me up mornings, but I want my program to play alarm sound as loud as its possible. so it needs to raise up volume to 100%. but I don't know how. I'm using python3 on macOS Sierra.
解决方案
You can control the volume of your computer with Applescript:
set volume output volume 100
To execute Applescript from python you can use py-applescript which can be installed with sudo easy_install py-applescript. The following script will set the volume:
import applescript
applescript.AppleScript("set volume output volume 100").run()
EDIT: For Python3.6 you can use osascript instead: pip3.6 install osascript and:
import osascript
osascript.osascript("set volume output volume 100")