how to check whether screen is off in mac/python?,main()