[Python] eye force rest during computer usage

Source: Internet
Author: User

Preface

Nowadays, computer people often forget the passage of time when using computers. They are either busy watching TV series, busy at work, or busy at games, the normal eye protection is often neglected, so that the eyes can get enough rest time when they are idle.

I am also one of them.

However, when I find my eyes getting tired, the demand for visual protection becomes increasingly urgent.

So I used my little programming skills and python's simplicity to implement the following "script for force eye rest". When the set working time is over, the display of the computer will be forcibly disabled. If you wake up with the mouse, the display will be quickly disabled until the set rest time is over.

The specific implementation is as follows:
Work_time = int (raw_input (break_time = break_time * 60 start = raw_input (OS _str = work_stage = (start = I, work_time-i, time. sleep (60 insleep = 1 start_time = OS _str = OS. system (OS _str = OS. system (end_time = end_time-start_time> insleep = OS _str = OS. system (OS _str = OS. system (work_stage = work_stage + 1, work_stage, start = raw_input ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.