0% found this document useful (0 votes)
64 views

SDLC BAnk Management System

This document contains the code for various operations performed on files such as writing, reading, appending, searching etc. It also contains code for performing stack operations like push, pop and display.

Uploaded by

kartikay patni
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

SDLC BAnk Management System

This document contains the code for various operations performed on files such as writing, reading, appending, searching etc. It also contains code for performing stack operations like push, pop and display.

Uploaded by

kartikay patni
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

DON BOSCO SR. SEC.

SCHOOL
PITHORAGARH
BANK MANAGEMENT SYSTEM

Project Made By:- Harsh Singh Kharayat

Kartikay Patni

Project Submitted to:- Mr. Vijay Gupta


#writing a file
f=open('making a file.txt','w')
f.write('name = kartikay class = 12
section = A' )
f.close()

#reading a text file with read mode


f=open('making a file.txt','r')
print (f.read ())
f.close()

#reading a text file without reading mode


(a+) appending mode
f=open('making a file.txt','a+')
print(f.read())
f.write('\nschool name = don bosco sr sec
school')
f.close()

import time
#reading a text file line wise
f=open('making a file.txt','r')
count=1
for c in f:
print("count=",count,c)
count+=1
f.close()

time.sleep(3) #for pause between the codes

#reading a text file using a clause for


splitting words
f=open('making a file.txt','r')
data=f.readlines()
for lines in data:
words=lines.split()
print(words)
f.close()

time.sleep(3)

#reading a text file using a clause for


counting no. of words
f=open('making a file.txt','r')
data=f.readlines()
no_of_words=0
for lines in data:
words=lines.split()
for word in words:
no_of_words+=1
print(word)
print("The File has Total"
,no_of_words,"words")
f.close()

import time

#reading a text file using a clause for


counting no. of characters
with open('making a file.txt','r') as f:
data=f.readlines()
for lines in data:
words=lines.split()
for word in words:
for c in word:
print(c)

time.sleep(5)#for pause between the codes


#reading a text file for counting no. of
characters in an easy way
with open('making a file.txt','r') as f:
c=''
while 1:
c=f.read(1)
if not c:
break
print(c,end="")

time.sleep(5)#for pause between the codes

#reading a text file for no. of alpabest


and digits
with open('making a file.txt','r') as f:
c=''
digit=alpha=0
while 1:
c=f.read(1)
if not c:
break
if (c.isdigit()):
digit+=1
elif (c.isalpha()):
alpha+=1
print("\n\n\n\nThere is/are Total"
,digit,"digit(s)")
print("\nThere is/are Total"
,alpha,"alphabet(s)")

import csv
with
open('Student_Details.csv','w',newline='')
as csvf:

writecsv=csv.writer(csvf,delimiter=',')
choice='y'
while choice.lower()=='y':
rl=int(input("Enter Roll No.: "))
n=input("Enter Name: ")
p=float(input("Enter Percentage:
"))
r=input("Enter Remarks: ")
writecsv.writerow([rl,n,p,r])
print(" Data saved in Student
Details file..")
choice=input("Want add more
record(y/n).....")

with
open('Student_Details.csv','r',newline='')
as fileobject:
readcsv=csv.reader(fileobject)
for i in readcsv:
print(i)

#Create a binary file with name and roll


number. Search for a given roll
#number and display the name, if not found
display appropriate message.
# 1. Inserting/Appending
# 2. Reading/Display
# 3. Seaching

import pickle
def Writerecord(sroll,sname):
with open ('StudentRecord1.dat','ab')
as Myfile:

srecord={"SROLL":sroll,"SNAME":sname}
pickle.dump(srecord,Myfile)

def Readrecord():
with open ('StudentRecord1.dat','rb')
as Myfile:
print("\n-------DISPALY STUDENTS
DETAILS--------")
print("\nRoll No.",'
','Name','\t',end='')
print()
while True:
try:
rec=pickle.load(Myfile)
print(' ',rec['SROLL'],'\t
' ,rec['SNAME'])
except EOFError:
break
def Input():
n=int(input("How many records you want
to create :"))
for ctr in range(n):
sroll=int(input("Enter Roll No: "))
sname=input("Enter Name: ")
Writerecord(sroll,sname)

def SearchRecord(roll):
with open ('StudentRecord1.dat','rb')
as Myfile:
while True:
try:
rec=pickle.load(Myfile)
if rec['SROLL']==roll:
print("Roll
NO:",rec['SROLL'])

print("Name:",rec['SNAME'])

except EOFError:
print("Record not
find..............")
print("Try
Again..............")
break

def main():

while True:
print('\nYour Choices are: ')
print('1.Insert Records')
print('2.Dispaly Records')
print('3.Search Records (By Roll
No)')
print('0.Exit (Enter 0 to exit)')
ch=int(input('Enter Your Choice:
'))
if ch==1:
Input()
elif ch==2:
Readrecord()
elif ch==3:
r=int(input("Enter a Rollno to
be Search: "))
SearchRecord(r)
else:
break
main()

print("1.PUSH\n2.POP\n3.DISPLAY\n4.Exit")
choice=int(input("please select any
operations mention above"))
if(choice==1):
data=int(input("PLease enter data for
stack"))
print(data,"Inserted Succesfully")
elif (choice==2):
if (s==[]):
print("under flow")
else:
data=s.pop()
print(data, "is removed from stack")
elif choice==3:
if (s==[]):
print("stack is empty")
else:
print("_"*20)

for peek in range(len(s)-1,-1):


print(s[peek])
print("_"*20,"\n\n\n")
elif choice==4:
pass
else:
print("invalid option")

You might also like