How to check whether screen is off in Mac/Python?,main()