0% found this document useful (0 votes)
26 views26 pages

Project

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views26 pages

Project

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

TEXT BASED EVENT CALENDER

RATHOD RAJNIKANT
PROJECT REPORT
On
Topic
Submitted to
Noble University, Junagadh
&
Drona Foundation
Institute Code: 738
Under the Guidance
Prof. Priti Mishra
In Partial Fulfillment of the Requirement of The
Award of The Degree of
Bachelor of Vocation ( B.Voc )
Offered By
Noble University & Drona Foundation
Prepared by:
Name :- RATHOD RAJNIKANT VIJAY BHAI
Enrollment No :- 230981026
B.Voc (Sem-I)
Month & Year:
July-December 2023
▪TOPIC
Create a text-based calendar or reminder
system to manage appointments and events.
➢ INPUT
import os

#Function to display the menu

def display_menu():
print("Text based calender")
print("1. View calender")
print("2.Add Event")
print("3. Exit")

#Function to view the calender

def view_calender():
with open ("calender.txt","r") as file:
calender = file.read()
print("calender:")
print(calender)

#Function to add an event to the calender

def add_event():
event_date = input("Enter the dete(dd-mm-yyyy):")
event_text = input("Enter the event:")
with open("calender.txt","a") as file:
file.write(f"{event_date}:{event_text}\n")
print("event added successfully")

#Main program loop

while True:
os.system('cls'if os.name == 'nt' else 'clear')#clear the console
display_menu()
choice = input("selected an option:")
if choice == '1':
view_calender()
elif choice =='2':
add_event()
elif choice =='3':
print("Good Bye!")
break
else:
print("invalid choice...please try again.")
➢ OUTPUT
EXPLANATION:
The code is a simple text-based calendar program that
allows users to view and add events to a calendar
stored in a file named "calendar.txt." Here's a
breakdown of the code
The program starts with a menu that provides three
options: view the calendar, add an event to the
calendar, and exit the program.

1. Displaying the Menu (display_menu()):


• This function simply displays a text-based menu to

the user when called.

• It provides three options: view the calendar, add an

event, and exit the program.


2. Viewing the Calendar (view_calendar()):
• This function reads the contents of a file named

"calendar.txt" and displays its contents on the

console.

• The assumption is that "calendar.txt" contains

calendar events, with each event in the format "dd-

mm-yyyy:event_description."

3. Adding an Event (add_event()):


• This function allows the user to input a date in the

format "dd-mm-yyyy" and an event description.

• It opens "calendar.txt" in append mode, adds the

event information to the end of the file, and then

prints a success message.


4. Main Program Loop:
• The main program loop (while True) runs

indefinitely until the user selects the exit option

(choice 3).

• It clears the console screen using os.system to

ensure a clean display before showing the menu

and taking user input.

• It reads the user's choice and executes the

corresponding action:

• If the choice is '1', it calls view_calendar() to

display the calendar.

• If the choice is '2', it calls add_event() to add an

event to the calendar.

• If the choice is '3', it prints a goodbye message and

exits the program.


• If the choice is anything else, it prints an "Invalid

choice" message and continues to the next iteration

of the loop.

5. Os.system :
• It uses os.system to clear the console. It checks the

operating system to determine whether to use 'cls'

for Windows ('nt') or 'clear' for Unix-like systems.


▪ Python
Python is a popular programming language. It
was created by Guido van Rossum, and
released in 1991.

It is used for:

• web development (server-side),


• software development,
• mathematics,
• system scripting.

Python is a high-level, general-purpose programming


language. Its design philosophy emphasizes code
readability with its notable use of significant
whitespace. Its language constructs and object-
oriented approach aim to help programmers write
clear, logical code for small and large-scale projects.

Python is dynamically typed and garbage-collected. It


supports multiple programming paradigms, including
structured (particularly, procedural), object-oriented,
and functional programming. It is often described as
a "batteries included" language due to its
comprehensive standard library.

Python has a large and active community that


supports it. There are many third-party libraries
available for extending its functionality.

Python is a programming language. Like other languages,


it gives us a way to communicate ideas. In the case of a
programming language, these ideas are “commands” that
people use to communicate with a computer! We convey
our commands to the computer by writing them in a text
file using a programming language. These files are called
programs. Running a program means telling a computer
to read the text file, translate it to the set of operations
that it understands, and perform those actions.

Here are some of the key features of


Python:
• Easy to learn:

Python has a simple syntax that is easy to read


and write. It is also a forgiving language, which
means that it will not give you errors for minor
mistakes.

• Versatile:

Python can be used for a wide variety of tasks,


including data science, machine learning, web
development, and scientific computing.

• Powerful:

Python has a large standard library that provides a


wide range of functionality. It can also be extended
with third-party libraries.

• Portable:

Python can run on a variety of platforms, including


Windows, Mac, and Linux.

• Free and open source:


Python is a free and open source language, which
means that it is available to everyone.
What can Python do?

• Python can be used on a server to create


web applications.
• Python can be used alongside software to
create workflows.
• Python can connect to database systems.
It can also read and modify files.
• Python can be used to handle big data and
perform complex mathematics.
• Python can be used for rapid prototyping,
or for production-ready software
development.

Why Python?

• Python works on different platforms


(Windows, Mac, Linux, Raspberry Pi, etc).
• Python has a simple syntax similar to the
English language.
• Python has syntax that allows developers
to write programs with fewer lines than
some other programming languages.
• Python runs on an interpreter system,
meaning that code can be executed as
soon as it is written. This means that
prototyping can be very quick.
• Python can be treated in a procedural way,
an object-oriented way or a functional
way.

Good to know

• The most recent major version of Python is


Python 3, which we shall be using in this
tutorial. However, Python 2, although not
being updated with anything other than
security updates, is still quite popular.
• In this tutorial Python will be written in a
text editor. It is possible to write Python in
an Integrated Development Environment,
such as Thonny, Pycharm, Netbeans or
Eclipse which are particularly useful when
managing larger collections of Python files.

Python Syntax compared to other


programming languages

• Python was designed for readability, and


has some similarities to the English
language with influence from mathematics.
• Python uses new lines to complete a
command, as opposed to other
programming languages which often use
semicolons or parentheses.
• Python relies on indentation, using
whitespace, to define scope; such as the
scope of loops, functions and classes.
Other programming languages often use
curly-brackets for this purpose.
o Errors
▪ Humans are prone to making mistakes.
Humans are also typically in charge of creating
computer programs. To compensate,
programming languages attempt to
understand and explain mistakes made in
their programs.

▪ Python refers to these mistakes as errors and


will point to the location where an error
occurred with a ^ character. When programs
throw errors that we didn’t expect to
encounter we call those errors bugs.
Programmers call the process of updating the
program so that it no longer produces
unexpected errors debugging.

Two common errors that we encounter


while writing Python are SyntaxError and
NameError

• SyntaxError means there is something


wrong with the way your program is written —
punctuation that does not belong, a command
where it is not expected, or a missing parenthesis
can all trigger a SyntaxError.

• A NameError occurs when the Python


interpreter sees a word it does not recognize.
Code that contains something that looks like a
variable but was never defined will throw a
NameError.

Reason for increasing popularity


1. Emphasis on code readability,
shorter codes, ease of writing
2. Programmers can express logical
concepts in fewer lines of code in
comparison to languages such as C++
or Java.
3. Python
supports multiple programming
paradigms, like object-oriented,
imperative and functional programming
or procedural.
4. There exists inbuilt functions for
almost all of the frequently used
concepts.
5. Philosophy is “Simplicity is the best”.

❖ LANGUAGE FEATURES
➢Interprete

▪ There are no separate compilation and

execution steps like C and C++.

▪ Directly run the program from the source

code.

▪ Internally, Python converts the source

code into an intermediate form called

bytecodes which is then translated into

native language of specific computer to

run it.
▪ No need to worry about linking and

loading with libraries, etc.

▪ Platform Independent
o Python programs can be developed
and executed on multiple operating
system platforms.
o Python can be used on Linux,
Windows, Macintosh, Solaris and
many more.
▪ Free and Open Source; Redistributable
▪ High-level Language
o In Python, no need to take care about
low-level details such as managing
the memory used by the program.
▪ Simple
o Closer to English language;Easy to
Learn
o More emphasis on the solution to the
problem rather than the syntax
▪ Embeddable
o Python can be used within C/C++
program to give scripting capabilities
for the program’s users.
▪ Robust:
o Exceptional handling features
o Memory management techniques in
built
▪ Rich Library Support
o The Python Standard Library is very
vast.
o Known as the “batteries
included” philosophy of Python ;It
can help do various things involving
regular expressions, documentation
generation, unit testing, threading,
databases, web browsers, CGI, email,
XML, HTML, WAV files,
cryptography, GUI and many more.
o Besides the standard library, there
are various other high-quality
libraries such as the Python Imaging
Library which is an amazingly simple
image manipulation library.
ADVANTAGES :
• Presence of third-party modules
• Extensive support libraries(NumPy for
numerical calculations, Pandas for data
analytics etc)
• Open source and community
development
• Versatile, Easy to read, learn and write
• User-friendly data structures
• High-level language
• Dynamically typed language(No need to
mention data type based on the value
assigned, it takes data type)
• Object-oriented language
• Portable and Interactive
• Ideal for prototypes – provide more
functionality with less coding
• Highly Efficient(Python’s clean object-
oriented design provides enhanced
process control, and the language is
equipped with excellent text processing
and integration capabilities, as well as
its own unit testing framework, which
makes it more efficient.)
• (IoT)Internet of Things Opportunities
• Interpreted Language
• Portable across Operating systems

DISADVANTAGES :
o Slow speed:
Python is an interpreted language, which
means that it is not converted to machine
code before it is executed. This can make it
slower than compiled languages, such as C
or Java.
o High memory usage:
Python uses a lot of memory, especially for
large datasets. This can be a problem on
low-memory devices, such as Raspberry Pi.
o Weak in mobile computing:
Python is not as well-suited for mobile
development as some other languages,
such as Java or Kotlin. This is because
Python's standard library does not include
many of the features that are needed for
mobile apps, such as touch support and
graphical user interfaces.
o Database access:
Python's database access layer is not as
well-developed as some other languages,
such as Java or SQL. This can make it
difficult to work with databases in Python.
o Runtime errors:
Python is a dynamically typed language,
which means that the type of a variable is
not checked until it is used. This can lead to
runtime errors, which can be difficult to
debug.
Despite these disadvantages, Python is a
powerful and versatile language that is used
in a wide variety of applications, such as data
science, machine learning, and web
development.

▪ APPLICATIONS :
1. GUI based desktop applications
2. Graphic design, image processing
applications, Games, and Scientific/
computational Applications
3. Web frameworks and applications
4. Enterprise and Business applications
5. Operating Systems
6. Education
7. Database Access
8. Language Development
9. Prototyping
10. Software Development
11. Google (Components of Google)
12. Yahoo (Maps)
13. YouTube
14. Mozilla
15. Dropbox
16. Microsoft
17. Cisco
18. Spotify
19. Quora

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy