We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9
BUS ALARM
PYTHON MINI PROJECT
INTRODUCTION • India is one of the emerging urban economies in the world. The growth is characterized by a specific shift in contributor to GDP from agriculture to manufacturing and tertiary sectors but the India’s transportation sector has not been able to pace up with the current developments. How can we make our transportation system more efficient? the only way is to incorporate better scheduling modules and by alerting the passengers of the scheduled time. • Our goal was to create an alarm which helps in alerting the passengers of the bus arrival with this the passenger can be present in the bus stop prior to the arrival of the bus which increases the possibility of the passenger getting into the bus. ABSTRACT • Timetabling and scheduling is the basics of all the transportation systems. It is necessary to take account of the passenger’s travel demand to meet both social and economic benefits for the transportation industry. The creation of an efficient alarm alerts the passengers of the arrival of the bus which helps them schedule more efficiently. • This alarm can efficiently prevent the fatalities caused due to the departure of the bus. The increasing population has led to the overcrowding of passengers in the bus stops due this the safety of the passenger’s is compromised this can be prevented if the passengers are aware of the time of the next bus arrival. Our project deals with alerting the passengers of the other buses arriving to the designated bus stops. LITERATURE SURVEY • For this project we have taken the code and information from different sources. The data for this information have been taken from different websites and the websites are listed below: • https://chalo.com/ • https://www.programiz.com/python-programming/online-compiler/ • https://data-flair.training/blogs/alarm-clock-python/ • https://github.com/David-Lor/PyBuses • https://stackoverflow.com/questions/16573051/sound-alarm-when-code-finishes • https://docs.python.org/3/library/tkinter.html • https://docs.python.org/3/extending/embedding.html#:~:text=The%20simplest%20form%20of%20embedding ,some%20operation%20on%20a%20file . • https://www.makeuseof.com/python-alarm-clock-simple-create/ DIFFERENCE BETWEEN THE PROPSED IDEA AND THE EXISTING IDEA • EXISTING IDEA: • Chalo is app which helps us to track out buses live, which will reduce the waiting time. • It also locates the closest bus stops ferry points and metro/train stations near us. • It provides a option to buy mobile tickets and bus passes on the chalo app. • It is restricted to a particular area. • Mohit Dubey, Priya Singh, Dhruv Chopra, Vinayak Bhavnani, and Nikhil Aggarwal are the founders of Chalo. • PROPOSED IDEA: • Bus alarm is an idea which helps us to reduces the waiting period. • This bus alarm sends an alarm when the bus is near to the desired bus stop so that the person can leave their place accordingly. • It tracks the bus and sends an alarm when it’s near to the desired bus stop. • Suppose a person lives around HAL and have to get the bus around 7 to get to the college in time, so the person have to enter their bus stop and timings at least 1 hr before so that it can tack the bus and sends an alarm when its nearby. • METHODOLOGY • First, we import all the necessary libraries and modules: • Tkinter module belongs to a standard library of GUI in Python. It helps us to create a dialog box with any information that we want to provide or get from the users. • Datetime and time modules in python help us to work with the dates and time of the current day when the user is operating python and to manipulate it too. • Winsound module provides access to the basic sound playing machinery provided by Windows platforms. This is useful to generate the sound immediately when a function is called. • 2. Create a while loop: • Define a function named as alarm() which takes the argument of (set_alarm_timer).It contains a while loop with a Boolean function True which makes the program automatic to work. • time.sleep(1) halts the execution of the further commands given until we get the time value from the user later in the code and returns the background thread of the clock time going on at a regular interval. • Get the current time using current_time which takes the argument of datetime.datetime.now(). METHODOLOGY • now is used to print the time and date is used to print the current date by string conversion using strftime(). • Define another function here named actual_time() which takes in the user value for setting the alarm in the string format. The same argument of (set_alarm_timer) as alarm before to execute the while loop which we further use while making GUI. • If loop suggests that if the user input time set_alarm_timer matches with the while loop ongoing time now, the message is printed as” Time to Wake up”. • winsound.SND_ASYNC plays the system generated sound as soon the condition satisfies, acting as a reminder for the alarm clock. • 3. Creating GUI using tkinter: • To Initialize tkinter, we pass a command under the name clock as Tk(). • The dialog box has the title as DataFlair Alarm Clock with a geometry of (400*200). We pass on the heading to mention the time format for 24 hours using time_format. • The second heading is given above the user input boxes for the labeling to be “Hour Min Sec” using addTime. • Just to make the dialog box look funkier, adding another label as “when to wake you up” using setYourAlarm. METHODOLOGY • As we have already converted the current time in the string before (actual time), the variables we initialize for the user input dialog boxes are in StringVar(). • Finally make the input boxes such as hourTime, minTime, and secTime which takes the entry of the time the user wants to set the alarm on in 24-hour format. • Submit takes the command of the defined function actual_time and executes the clock as it acts as a set button to start the program. • Clock.mainloop() is the basic and the last command was given to compile all the previous commands with their basic settings of color, font, width, axis, etc. and displays the window as soon as the program is run. ADVANTAGES AND DISADVANTAGES