Godfrey event
November 27 during recording "chase me" Ninth programs in the current period Panelists high to suddenly slow down when running Xiang fell to the ground, the program launched the first on-site medical treatment, and urgently sent to local hospitals. After more than two hours of rescue, the hospital finally announced Godfrey sudden cardiac death .
After this unfortunate incident, the community has been closely watched. From a sorry fans, to denounce the program group, and various causes of death analysis reports, online news overwhelming. If, however, the highest death rate on the occupation, we should not be programmers do?
Sudden death in high-risk occupation
Sudden death overtime every year tens of thousands of programmers, but I ask my colleagues whether we are so social serious attention, but also the country has issued any relevant policies to protect such high-risk groups? nothing!!!
Tired, someone cares about you, comfort you, is your lucky.
If luck is not coming to your head, you have to learn to use his left hand warm his right hand,
you have to tell yourself, everything will be past.
Since others do not care about programmers, we can only learn self-care of. Today we use Python to help thousands of programmers away from sudden death!
Sedentary beverages
Remember the first generation of millet bracelet on sale when, out of the sedentary remind this function. " Sedentary " harm to the person, has long been recognized by the world. Specifically, what does? Sedentary be hazardous to your colon, spine, neck, heart, pancreas, hips, legs. As to the specific content, we can take a closer look down.
So much harm in the face, but often because programmers rush demand, change BUG, check the information and sit for a few hours, do not hold back the urine less than move house. (As I write this article, has been sitting in a row on the computer side for three hours ...) detailed yourself if you have had these experiences!
Well, today we use Python developed a sedentary reminder gadget , so that each programmer can reasonably rest, time to get up and move around, away from the sudden death hazard!
programming
Python how to complete the sedentary reminder function? Initially considered regular mail, or micro-channel messages, text messages and other operations. But up there time to focus on these concerns? Finally think, it is better to develop a GUI tool that allows the programmer to set a countdown, and then see the computer screen to automatically lock when forced everyone up and walk, relax. So we have the following effects:
In order to set up a comprehensive range of time, I added a way to support fractional, but also to be able to easily record screen presentation.
However, in order to avoid sudden lock screen, causing discomfort. It will give prompt pop in front of the lock screen 10 seconds. This will not be too abrupt. This idea has triggered can be a problem.
tkinter The message will block the process , the user does not click cancel the message window, can not continue. In order to enable prompt message pops up at the same time, the countdown to the countdown continues, we need to introduce threading and Toplevel module, create a child window, and wait for three seconds to destroy it.
Automatic lock screen
Familiar bat script of children's shoes all know, bat has shutdown commands can be used to periodically restart, shutdown, but no lock screen. Check for a long time to no avail, and finally only reluctantly by Python ctypes calling windll module, complete lock-screen operation, the specific code as follows:
Use code
You can go to my github download all articles Code: https://github.com/BreezePython
Since we want the benefit of thousands of programmers, so it would be best can be packaged into exe tool, easy to spread out of context!
Use the command pyinstaller -F -w -i love.ico CareForCoders.py
to package
-F packaged into a single file, -w -i cancel cmd window to add software ico icon, to see the effect it: