Project Count Important
Project Count Important
PROJECT REPORT
Submitted by
SACHIN A(22127006)
DHONI DHASS (22127003)
BALAJI (22127001)
MR. SELVAKRISHNAN
ASSISTANT PROFESSOR
HITS
3th Semester
NOV 2023
BONAFIDE CERTIFICATE
Certified that COUNTDOWN TIMER is the Bonafide work of SACHIN A(22127006), DHONI
DHASS(22127003),BALAJI (22127001) who carried out
the project work under my supervision during the academic year 2023.
Supervisor
MR. SELAKRISHNAN
ASSISTANT
PROFESSOR
ACKNOWLEDGEMENT
We thank Dr. M. SAMBATH, Head of the Department of Information Technology for his
strong support and encouragement throughout our course of study We express deep gratitude
to our Mentor MR. SELVAKRISHNAN S, Department of Information Technologyfor their
constant guidance and continued assistance in the completion of this design project and
software development.
We thank all the Faculty members and Technical staff of the Department of Information
Technology for their valuable support and suggestions at various stages of design project
development.
We are extremely indebted to our family members for their adorable support and care.
TABLE OF CONTENTS
S.NO TITLE PAGE NO
1 ABSTRACT 5
2 INTRODUCTION 5
3 PROBLEM STATEMENT 6
4 LITERATURE REVIEW 7
5 PROPOSED SYSTEM 7
7 REQUIREMENT SPECIFICATION 8
9 SYSTEM SPECIFICATION 9
10 FUTURE ENHANCEMENT 10
11 CONCLUSION 11
12 REFERENCES 11
1. ABSTRACT
Learn how to build a real-time countdown timer in Python
with concurrent user input. This article covers the basics of Python's
datetime and time modules, as well as how to handle user input in real-
time. By the end of this tutorial, you'll have a fully functional countdown
timer that can be used in a variety of applications.
Python is a versatile programming language that can be used to create a
wide range of applications, including real-time countdown timers with
concurrent user input. In this article, we will show you how to create a
simple countdown timer using Python's Tkinter library and how to allow
multiple users to input their own countdown value.
2. INTRODUCTION
In 2020, one hundred years will pass since the first traffic lights based on the use of three
lights red, yellow and green designed by William Potts were applied in practice. This system
is a foundation of the currently operating traffic lights around the world. Certainly, it does not
mean that this is a perfect solution. In fact, the time wasted at intersections with traffic lights
is significant. They cause not only financial but also social and increasingly noticeable
environmental losses. Other adverse aspect of intersections with traffic lights relates to risks
associated with the need to take rapid decisions while the signal changes from green to
yellow and to decide on whether to start braking maneuver to stop before a stop line or to
continue driving to cross the intersection. It is very often a complex and difficult decision
since when the signal is changing from green to yellow, a vehicle moving at a permissible
speed at a distance from the signaling device may be in a so-called dilemma zone. The
dilemma zone concept was developed by the team of Gazis, Herman and Maradudin already
in the 1960s [9]. A dilemma zone is an area near to an intersection where a driver has a
problem of taking right decisions when the yellow signal appears. He cannot safely cross the
intersection, since the distance that can be covered by the vehicle during the yellow signal is
shorter than the distance needed to reach the stop line
3. PROBLEM STATEMENT
we'll look at how to use Python to make a countdown 琀椀mer. The user's input on the
countdown's dura琀椀on in seconds will be used by the code. Following that, a countdown with
the format "minutes: seconds" will start on the screen. The 琀椀me module will be used here.
Steps to be Followed:
We'll use Python's 琀椀me and date琀椀me libraries to build a straigh琀昀orward 琀椀mer.
Classes, func琀椀ons, variables, and executable code are all contained in modules, which are
昀椀les in Python. We can use each element contained in a module by impor琀椀ng it into our
programme.
The standard library of the Python programming language has more than 200 prede昀椀ned
modules. We can even design custom modules for you to be used in future ini琀椀a琀椀ves.
4. LITERATURE REVIEW
Based on the literature review, it has been proved that countdown 琀椀mers are very useful,
improve comfort, safety and smoothness of tra昀케c in the opinion of drivers. The results of
research caried out by various authors are consistent in this respect
5.PROPOSED SYSTEM
The CMSIS RTOS API can be used to de昀椀ne any number of virtual 琀椀mers, which act as
countdown 琀椀mers. When they expire, they will run a user callback func琀椀on to perform a
speci昀椀c ac琀椀on. Each 琀椀mer can be con昀椀gured as a one shot or repeat 琀椀mer. A virtual 琀椀mer is
created by 昀椀rst de昀椀ning a 琀椀mer structure.
osTimerDef(琀椀mer0,led_func琀椀on);
This de昀椀nes a name for the 琀椀mer and the name of the callback func琀椀on. The 琀椀mer must
then be instan琀椀ated in an RTOS thread.
This creates the 琀椀mer and de昀椀nes it as a periodic 琀椀mer or a single shot 琀椀mer (osTimerOnce).
The 昀椀nal parameter passes an argument to the callback func琀椀on when the 琀椀mer expires.
osTimerStart (琀椀mer0_handle,0x100);
The 琀椀mer can then be started at any point in a thread; the 琀椀mer start func琀椀on invokes the
琀椀mer by its handle and de昀椀nes a count period in milliseconds
Our objec琀椀ve is to create a GUI window, which will set a countdown 琀椀mer depending on
entry by the user. In addi琀椀on to this, our window will also display the current 琀椀me at which
the window opens up. Once the alarm goes o昀昀, we will get a desktop no琀椀昀椀ca琀椀on. We will
also have an op琀椀on to produce a beep sound once the 琀椀mer goes o昀昀.
Python Countdown Timer can be u琀椀lized to wait for a certain dura琀椀on of 琀椀me in the idle
state before reitera琀椀ng the same piece of code in the loop again as required. Python's 琀椀me
library contains a prede昀椀ned sleep() func琀椀on.
7.REQUIREMENT SPECIFICATION
Requirements Speci昀椀ca琀椀on:
Python 3.7
Django 3.0.7
User Interface (UI): The UI will be the primary interface for user interaction,
allowing them to input timer information. The UI will be designed using a
combination of HTML, CSS, and JavaScript to ensure a user-friendly and
responsive experience across different devices and browsers.
Machine Learning Model: The machine learning model will serve as the
core predictive engine, responsible for generating timer predictions based
on user-provided timedata. The model will be trained on a comprehensive
dataset of vehicle attributes and corresponding timer values, ensuring its
ability to capture complex relationships between input features and the
target variable(Timer).
Methodology
We shall make use of the time module's sleep() function in this project. To make a
countdown timer, adhere to the instructions below:
The user-defined method countdown receives this value as an argument 't' ().
A string is the type of variable that the input function can read. Since this
parameter is of the string type, transform it to a "int."
A while loop in this function continues to execute until time equals 0.
Calculate the duration in minutes and seconds using divmod(). Find out more
about it by reading this.
Using the variable time format, output the minutes and seconds just on screen.
By using end = "r" to drive the pointer to the beginning of the screen (a carriage
return), we can ensure that the following line will print over the preceding one.
To make the code pause for a second, use the time.sleep() function.
In order for the while loop to converge, move on to step 9 and decrease time.
To signal the end of a countdown, we will print "Fire in the hole" after the loop
has finished.
9.SYSTEM SPECIFICATION
Hardware Requirements
A powerful server with su昀케cient processing power, memory, and storage capacity to
handle data processing, machine learning tasks, and user requests.
A stable and reliable network connec琀椀on to facilitate communica琀椀on with the user
interface and the machine learning model.
So昀琀ware Requirements
Linux or Windows opera琀椀ng system for running the server-side applica琀椀ons and machine
learning model.
JavaScript, HTML, and CSS for crea琀椀ng the user interface.
Python or Node.js for backend server development and machine learning tasks.
Machine learning libraries like TensorFlow or Scikit-learn for building, evalua琀椀ng, and
deploying the machine learning model.
Web frameworks like Django or Express.js for developing the backend server and handling
user requests.
A database like PostgreSQL or MySQL for storing and managing the vehicle dataset.
The date琀椀me module contains everything we need to make a countdown to a future date
10
and 琀椀me.
What we need is a 琀椀medelta object. A 琀椀medelta object represents the di昀昀erence between
2 date琀椀me objects. From this 琀椀medelta object we can easily extract the number of days,
hours, minutes and seconds.
One date琀椀me object should represent the date and 琀椀me to which we are coun琀椀ng down.
This can be created with the strp琀椀me func琀椀on. This takes 2 strings. First a date and 琀椀me in
a string and second a string that speci昀椀es the format of how the date琀椀me string is made.
The other date琀椀me object should represent the current date琀椀me. This can be made with
the now func琀椀on.
Now we know what we need, let’s get busy with it.
Transforming a date琀椀me string to a date琀椀me object
We can use the strp琀椀me func琀椀on from the date琀椀me module to transform a string that
holds date琀椀me data to a real date琀椀me object.
An example date琀椀me string
Let’s say we have a string that holds the date and 琀椀me of the 2023 Monaco GP:
11
11. CONCLUSION
Python Countdown Timer can be utilized to wait for a certain duration of time in the idle state
before reiterating the same piece of code in the loop again as required. Python’s time library
contains a predefined sleep() function. The “duration” for which we want to delay the
execution is passed as an argument to the sleep() function in seconds. This function, in
combination with a loop, serves as the Python countdown timer.
Recommended Articles
This is a guide to Python Countdown Timer. Here we discuss how do the Python Countdown
Timer Works along with the respective examples. You can also go through our other related
articles to learn more.
12. REFERENCES
13. www.
techvidvan.co
m
12
14. www.
pythonbasics.
org
15. www.
pypi.org
www.
techvidvan.co
m
13
www.
pythonbasics.
org
www.
pypi.org
www.
techvidvan.co
m
14
www.
pythonbasics.
org
www.
pypi.org
www.
techvidvan.co
m
15
www.
pythonbasics.
org
www.
pypi.org
www.techvivdan.com
www.pythonbasics.org
www.pypi.org
16
www.
techvidvan.co
m
www.
pythonbasics.
org
www.
pypi.org
17
SOURCE CODE:
import 琀椀me
def countdown(t):
while t:
print(琀椀mer, end="\r")
琀椀me.sleep(1)
t -= 1
# func琀椀on call
countdown(int(t))
18
SCREEN SHOTS
19
20
21