Ip Project
Ip Project
1.Introduction ……………………………………….…
3.CSV…………………………………………………....
6.Outputs ………………………………………….……
8. Bibliography…………………………………………
ACKNOWLEDGEMENT
INTRODUCTION
FLOW CHART
import pandas as pd
import os
import datetime
date =
str(datetime.datetime.now())
date = date[:19]
file =
open('receipt.txt','w')
import warnings
warnings.filterwarnings('ignore') #to ignore warning raised by
altering
the dataframe
print() # styling
def booking():
PNR() #calling the function
print("="*65) #styling
print("\t\t\tWelcome to Booking Department")
print("="*65) #styling
print("-"*65) #styling
print("\t\t\tSelect from following
trains") print("-"*65,'\n') #styling
print(all_trains)
print("-"*65) #styling
print('\t\t\tCurrent seat
status') print('-'*65,'\n')
#styling
print(train_no)
while True:
coach = input("Enter exact coach as written in table for
which you want seat(s) : ") #taking desired coach type from
user
if coach in coach_list: #if it matches with the coach present in
the coach_list
index = train_no[train_no['Coach']==coach].index.values
#taking out the index at which coach type is present
train_no.Seats[index] -= number_of_seats #differencing
the inoutted number of seats on that index(coach)
file.write('\n\n\n') #styling
file.write("="*73);file.write('\n') #styling
file.write("\t\t\tINVOICE\t\t");file.write('\n')
file.write("="*73);file.write('\n') #styling
file.write("DATE:\t\t\t\t");
file.write(str(date));file.write('\n')
file.write("="*73);file.write('\n')
#styling file.write("Train No.\
tCoach\tNo. of
Seats\tPrice\t\tTotal");file.write('\n') #styling
file.write(str(train_no.iloc[0,0]));
file.write('\t\t');
file.write(coach); file.write('\
t\t\t');
file.write(str(number_of_seat
s)); file.write('\t\t\t');
file.write(str(Price));
file.write('\t\t\t');
file.write(str(Price*number_of_seats));file.writ
file.write("="*73);
file.write('\n')#styling
file.write("Your PNR is :
");
file.write(str(new_pnr));
file.write('\n') #styling
def PNR_Enquiry():
pnr = int(input("Enter your PNR :
")) print()
index = passengers[passengers['PNR
No.']==pnr].index.values #finding the index of passengers
given pnr number
index = index[::-
1] for i in index:
print(passengers.loc[i],'\n\n') #printing the seat number of
the selected index(PNR number)
def Cancel_Ticket():
pnr = int(input("Enter your PNR :
")) global value #creating a global
variable
passengers = pd.read_csv(r"passengers.csv") # importing
the passengers list in dataframe
value = passengers[passengers['PNR
No.']==pnr].index.values #finding the index of passengers
given pnr number
for i in value:
cancelled.loc[len(cancelled.index)] = passengers.iloc[i]
#dropping the passengers data from dataframe
passengers.drop(value,inplace=True) #updating the
dataframe print()
print()
print("Your ticket(s) have been susscessfully
Cancelled !!!") print()
print()
cancelled.to_csv(r'cancelled.csv',index=False) #updating the
cancelled excel file
passengers.to_csv(r'passengers.csv',index=False) #updating
the passengers excel file
name = input("Please Enter your name : ") # taking name from the
user
while True : #Making all the things in a loop, exit only when
4(Exit) is given as input
try:
work_type = int(work_type)
except:
ValueError
if work_type == 1:
booking()
file =
open('receipt.txt','r')
data = file.read()
file.close()
print(data)
If you choose 1
If you choose 2
If you choose 3
If you choose 4
4.1 SOFTWARE REQUIREMENTS:
• Windows OS
• Python Spyder 2.7 or higher should be installed
• CSV with Connect database
• Python -CSV connector module should be installed
4.2HARDWARE REQUIREMENTS :
1. https://www.CSV.org/
2. https://www.python.org/
3. Informatics Practices(new) XII- Sumita
Arora
4. https://www.slideshare.com
1. Go to python.org
your system
4. Follow the on-screen instruction
CERTIFICATE
………………….. …………………..
Signature of Teacher Signature of
External
…………………..
Signature of Principal
CSV
for
AISSCE 2O25 EXAMINATION
By :
Vidhi Dangi
&
Jenny Pagariya
Under the Guidance of :
Mr. Kapil Upadhyay