Posts

Showing posts from June, 2026

How to implement alarm clock in python?

              Alarm plays an important role in everyday life. If your python program sets your alarm from your input. Here, is the code follows…. How to do it? This program starts from importing the built-in files. One is datetime and another one is time. Next one is winsound to create alarm sound. First step is to create the set_alarm code. Let us get the input from user for hour and minute to set the alarm. It is named as alarm_hour,alarm_minute. Get the time now. Set the alarm time. If the time crosses, make it for tomorrow. Otherwise, set the sound for the alarm time. Code: #import built-in files import datetime import time import winsound   def set_alarm():     # Ask user for alarm time     alarm_hour = int(input("Enter hour (0-23): "))     alarm_minute = int(input("Enter minute (0-59): "))     now = datetime.datetime.now()    ...

How to create a To-Do list in python

               Planning is very important for any task management. Let us create a To-Do list using python. Steps to follow: ·        This program starts with importing a built-in   file ‘os’. ·        F_NAME is the file name. it is assigned with a txt file name. ·        There are three functions. ‘load_it()’,’save_it()’,’show_it()’. ·        ‘load_it()’ opens the file if exists. Otherwise, it displays the error message. ·        ‘save_it()’ opens the file and writes the content which was given by user. ·        ‘show_it()’ displays the todo list tasks. ·        ‘main()’ function displays the options. Based on the user preference, the data is read,write and display accordingly. Code: import os F_NAME = "todolist.t...

How to run the automation scripts in python?

Image
What are automation Scripts?               A code that can be reusable to execute a function in multiple times. It automatically executed without any user intervention. In python, it is stored with ‘.py’ extension. Steps to execute the automation scripts: 1.Python Installation ·        First, make sure that system has python. ·        Just check the version in command prompt. ·        Open the command prompt by giving ‘cmd’ command in search panel. ·        It opens the command prompt. ·        Use the below syntax to check the version. C:\Users\rajeswari jeevananth>python --version Python 3.10.0 2. Set up your Environment for windows ·      Create a project folder. 3. Create the automation script     ...