Professional Documents
Culture Documents
RAILWAY
RAILWAY
RAILWAY
CERTIFICATE
ACKNOWLEDGEMENT
ABOUT PYTHON
INTRODUCTION OF PROJECT
SOURCE CODE
OUTPUTS
GRAPH
BIBLIOGRAPHY
1 | Page
ABOUT PYTHON
Python was conceived in the late 1980s as a successor to the ABC language.
Python 2.0, released in 2000, introduced features like list comprehensions and a
garbage collection system capable of collecting reference cycles. Python 3.0,
released in 2008, was a major revision of the language that is not completely
backward-compatible, and much python 2 code does not run unmodified on
python 3.
The python 2 language, i.e. Python 2.7.X, was officially discontinued on January
1, 2020 (first planned for 2015) after which security patches and other
improvements will not be released for it.
With python 2’s end-of-life, only Python 3.5.x and later are supported.
2 | Page
HISTORY OF PYTHON
Python was conceived in the late 1980s[by Guido van Rossum at Centrum
Wiskunde & Informatics (CWI) in the Netherlands as a successor to the ABC
language (itself inspired by SETL), capable of exception handling and
interfacing with the Amoeba operating system. Its implementation began in
December 1989.(35] Van Rossum shouldered sole responsibility for the project,
as the lead developer, until July 12, 2018, when he announced his permanent
vacation responsibilities as Python's Benevolent Dictator For Life, a title the
Python community bestowed upon him to reflect his long-term commitment as
the project's chief decision-maker. He now shares his leadership as a member
of a five person steering council.
3 | Page
What is CSV file?
A CSV is a comma-separated values file, which allows data to be saved in a
tabular format. CSVs look like a garden-variety spreadsheet but with a .csv
extension.
CSV files can be used with most any spreadsheet program, such as Microsoft
Excel or Google Spreadsheets. They differ from other spreadsheet file types
because you can only have a single sheet in a file, they cannot save cell, column,
or row. Also, you cannot save formulas in this format.
CSV files are plain-text files, making them easier for the website developer to
create.
Since they're plain text, they're easier to import into a spreadsheet or another
storage database, regardless of the specific software you're using
4 | Page
CSV FILES:-
5 | Page
ABOUT RAILWAY RESERVATION SYSTEM
Railway Reservation System is developed for to automate the railway
reservation system. It includes modules required to successfully operate railway
reversion process smoothly. It has train master to add modify train information,
Train schedule to enter train journey details include all the station name, arrival
time and departure time. It includes automatic fare calculation as per the distance
between two stations.
OBJECTIVES
Our project introduces railway reservation system with an objective to make the
reservation system more efficient, easier and fast. This project explores how
computer technology can be used to solve the problem of user. The main
objectives provided by this software are as follows:
To enquire about availability of trains
To reserve and cancel their seats
To modify the information related to
To show all the reservation
To show the passenger name record(PNR)
6 | Page
Working
We have taken two CSV files namely CSVM.csv (Train Route) and
CSVN.csv (Reservation details).
With python pandas program and data from CSV files we have completed this
project.
7 | Page
LIMITATIONS OF EXISTING SYSTEM: -
Data redundancy:
It means that same data fields appear in many different files and often in different
formats. In manual system, it poses quite a big problem because the data has to be
maintained in large volumes but in our system, this problem can be overcome by
providing the condition that if the data entered is duplicate, it will not be entered,
otherwise, updating will take place.
8 | Page
CODING
#program on train reservation (project 2020 -2021) import pandas as pd
import numpy as np
import sys
import random
print(' '*8,".....welcome to reservcation online......................")
print() print() while(True):
df=pd.read_csv("C:/Documents/CSVM.csv",index_col="sno")
lf=pd.read_csv("C:/Documents/CSVN.csv",index_col="pnr_no") def
writcsv(lf):
lf.to_csv("C:/Documents/CSVN.csv",na_rep='NULL') def writecsv(df):
df.to_csv("C:/Documents/CSVM.csv",na_rep='NULL')
print('''1)Add Train Details 2)Remove Train Detail
3) New Reservation
6)QUIT''')
9 | Page
elif option==3: print()
name=input("enter your name") print()
age=int(input("enter your age")) print()
way_from=input("enter way from station") print()
10 | P a g e
way_to=input("enter way to station") print()
pnr_no=random.randint(111111,999999) fare=random.randint(500,1500)
conformation='y'
lf.loc[pnr_no,:]=[name,age,way_from,way_to,conformation,fare] writcsv(lf)
print('processing...')
print() print() print(lf) print() print()
elif option==4: print() print(lf) print() print()
elif option==5:
print(' '*10,'*** | | PNR_NO |__| ***') print()
print(pd.Series(lf.index)) print()
print()
pnr_no=int(input("enter your pnr_no.")) print()
detail=lf.loc[pnr_no,:] print()
print(' '*10,'Details related with this ',pnr_no,'is...') print()
print() print(detail) print() print()
else:
sys.exit() enter=input('press enter:') print()
print(' '*10,'reservation details...') print()
print() print(lf) print() print()
print(' '*10,'train details...') print()
print() print(df) print() print()
if(input('do u want ot continue y/n')=='n'):
break
11 | P a g e
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>
================ RESTART: C:\python\Python38\ip project board.py
===============
.....welcome to Reservation online.....
3)New Reservation
6)QUIT
Select your option:
3)New Reservation
processing...
press enter:
reservation details...
3) 3)New Reservation
6)QUIT
Select your option:2
3)New Reservation
13 | P a g e
6) QUIT
Select your option:3 enter your namekrishna enter your age17
enter way from stationBokaro steel city enter way to station Mumbai
processing...
press enter:
3)New Reservation
press enter:
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>
================ RESTART: C:\python\Python38\ip project board.py
===============
.....welcome to Reservation online.....
3)New Reservation
6) QUIT
Select your option:5
***|__| PNR_NO | | ***
0 536334
1 235443
2 435435
3 233233
4 865687
5 994536
6 373255
7 317941
8 129816
9 866898
Name: pnr_no, dtype: int64 enter your pnr_no.235443
name ashish
age 19
way_from raipur
way_to indore conformation n fare
874
Name: 235443, dtype:object press enter:
15 | P a g e
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>
================ RESTART: C:\python\Python38\ip project board.py
===============
.....welcome to Reservation online.....
3) New Reservation
6) QUIT
Select your option:
>>>
16 | P a g e
17 | P a g e
BIBLIOGRAPHY
18 | P a g e