Created
June 26, 2018 02:01
-
-
Save PythonCoderAS/8d3401ddd68f51597188195cfe075528 to your computer and use it in GitHub Desktop.
Calculate the last day of school for BSGE year 2017-18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime | |
| from time import sleep | |
| def get_time(): | |
| time_left = datetime(2018,6,26,11,10,00) - datetime.now() | |
| if str(time_left)[0] == '-': | |
| print('School is over! Exiting now.') | |
| exit(0) | |
| else: | |
| return str(time_left).split('.')[0] | |
| def main(): | |
| while True: | |
| print('\rTime until end of school: '+get_time(), end = '') | |
| sleep(1) | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment