Advertisement
Python253

20to0_timer

Mar 3rd, 2024 (edited)
898
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.00 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # A Simple 20 Second Countdown Created With Python Scripting.
  4. # Original script can be found here:  https://pastebin.com/4TVk3Bx3
  5.  
  6. __file_name__ = '20to0.py'
  7. __author__ = 'Dan Evans'
  8. __copyright__ = 'Copyright 2016©, Coding With Py'
  9. __credits__ = 'Dan Evans'
  10. __dct_url__ = 'http://purl.org/dc/terms/'
  11. __license__ = 'Creative Commons'
  12. __rel_url__ = 'http://creativecommons.org/licenses/by-nc/4.0/'
  13. __version__ = 'CC-by-nc/4.0/'
  14. __maintainer__ = 'Dan(Python253)Evans'
  15. __email__ = 'Python253@gmail.com'
  16. __last_update__ = '03/03/24'
  17.  
  18. """
  19. 20to0.py - A Simple 20 Second Countdown
  20.  
  21. This Python script, '20to0.py', authored by Dan Evans, creates a playful 20-second countdown experience.
  22. The script utilizes a 'while' loop to decrement the countdown timer and display the remaining seconds.
  23. To enhance the user experience, a one-second delay is introduced between each countdown step using the 'time' module, providing a real-time countdown sensation.
  24.  
  25. Feel free to use, modify, and share this script under the terms of the Creative Commons Attribution-NonCommercial 4.0 International License.
  26. """
  27.  
  28. print('\n', '20to0.py is licensed under',
  29.       '\n', 'The Creative Commons Attribution-NonCommercial',
  30.       '\n', '4.0 International License',
  31.       '\n' * 2, 'File Name: ' + __file_name__, '\n', 'Author: ' + __author__,
  32.       '\n', 'Copyright: ' + __copyright__, '\n', 'Credits: ' + __credits__,
  33.       '\n', 'DCT URL: ', '\n', __dct_url__, '\n', 'License: ' + __license__,
  34.       '\n', 'Release URL: ', '\n', __rel_url__, '\n', 'Version: ' + __version__,
  35.       '\n', 'Maintainer: ' + __maintainer__, '\n', 'Email: ' + __email__,
  36.       '\n', 'Last Update: ' + __last_update__, '\n')
  37.  
  38. import time
  39.  
  40. # This Script Counts Down From 20 to 0 Seconds.
  41. i = 20  # Edit this value for timer length in seconds
  42. print("\n\nCountdown Started...\n\n")
  43. while i > 0:
  44.     print(i)
  45.     time.sleep(1)  # Introduce a 1-second delay
  46.     i -= 1
  47.  
  48. print('\nCountdown Complete!\n')
  49. # End
  50.  
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement