Skip to main content

bank account simple project on python .


  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import pickle

accounts=dict()
class Account:
    """SImple bank account """

    def __init__(self,name,balance):
        self.name=name
        self.balance=balance

    def getname(self):
        return self.name



    def deposit(self,amount):
        if amount>0:
            self.balance+=amount
    def withdraw(self,amount):
        try:
            assert (amount>0)
        except:
            print("NO negative amount could be withdrawn")
        try:
            assert (balance-amount>0)
        except :
            print("maximum balance that could be withdrawn =",balance)
        balance-=amount
    def showbalance(self):
        print("*"*80,"\n\t\tCurrent Balance->",self.balance,"\b\n","*"*79)
        return self.balance

    def getbalance(self):
        return  self.balance


def new():
    while True:
        name=''
        print("\n1.to Add an Account \n2.Deposit\n3.Withdraw\n4.View Balance\n5.View All Accounts Currenty Available \n6.Exit   \n S or s to save ")
        choice=input()
        if choice=='1':
            name=input("Enter name->")
            temp=Account(name,0.0)
            accounts[name]=temp

        elif choice=='2':
            if name=='':
                name=input("Enter Name:->")
            if name in accounts.keys():
                print("how much to add")
                amount=float(input())
                if name in accounts:
                    temp=accounts[name]
                    temp.deposit(amount)
                else:
                    print('Error Account Do not exist ')

        elif choice=='3':
            if name=='':
                name=input("Enter Name:->")
            if name in accounts.keys():
                print("how much to Withdraw")
                amount=float(input())
                if name in accounts:
                    temp=accounts[name]
                    temp.withdraw(amount)
                else:
                    print('Error Account Do not exist ')
        elif choice=='4':
            if name=='':
                name=input("Enter Name:->")

            if name in accounts:
                temp=accounts[name]
                temp.showbalance()
            else :
                print('Error Account Do not exist ')
        elif choice=='6':
            break
        elif choice=='121':
            print(accounts)
        elif choice=='5':
            print('*'*120)
            print('\n\tName\t\t\t\t\tBalance')
            for key in accounts.keys():
                print('-' * 80)
                print('\t',key,'\t\t\t\t\t',accounts[key].getbalance())
                print('-' * 80)

            print('*' * 120)
        elif choice=='s' or 'S':
            pic_file = open('account_dump', 'ab')
            key_file = open('keydump', 'wb')
            pickle.dump(accounts, key_file)
            key_file.close()
            for key in accounts.keys():
                temp = accounts[key]
                print("temp being dumped", temp)
                temp.showbalance()
                pickle.dump(temp, pic_file, protocol=pickle.HIGHEST_PROTOCOL)
                pickle.dump(temp.balance, pic_file, protocol=pickle.HIGHEST_PROTOCOL)

            pic_file.close()
        else :
            print ('Please give correct input ')
            pass


def load():
    try:
       temp=open('keydump','rb')
       temp2=open('account_dump','rb')
    except Exception:
         print("NO previous record found . Start a new banking ")
         menu()
    details=pickle.load(temp2)
    key_details=pickle.load(temp)
    print('printing Key details')
    print(key_details)
    for i in (key_details):
        details = pickle.load(temp2)
        print("----1----",details.getbalance())
        accounts[i]=details
        details = pickle.load(temp2)
        print("----2----", details.getbalance())
    print('printing acc details')
    print(accounts)
    print('loading complete')
    temp2.close()
    temp.close()
    new()

def menu():
    choice=input('1.NEW Banking ---RESTART\n2.Load->')
    if choice=='1':
        new()
    if choice=='2':
        load()
    if choice=='q' or choice=='Q':

        exit()

    menu()

if __name__=="__main__":
    menu()

Comments

Popular posts from this blog

13 websites to register your free domain

Register your Free Domain Now!! 1)  .tk Dot TK is a FREE domain registry for websites on the Internet. It has exactly the same power as other domain extensions, but it’s free! Because it’s free, millions of others have been using .TK domains since 2001 – which makes .TK powerful and very recognizable.  Your website will be like www.yourdomainname.tk . It is free for 1 year. It’s a ccTLD domain whixh having the abbreviation  Tokelau. To create a .tk domain, Visit   www.dot.tk 2) co.cc Co.cc is completely free domain which is mostly used by blogspot bloggers because of it’s easy to use DNS system. Creating a co.cc for blogger is simple ( for instructions- “click here”). Your website will be like www.yourdomainname.co.cc . To create a .co.cc domain, visit www.co.cc 3)   co.nr co.nr is too like co.cc. Your website will be like  www.yourdomainname.co.nr . You can add it for blogger also.. To create a .co.cc domain, vi...

what is LOREM ipsum and why do designers use it

What is Lorem Ipsum? Lorem Ipsum  is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now...

Streamlining Java Web Application Deployment with React WAR Generator

In the ever-evolving world of web development, managing builds and deployments can often be cumbersome and error-prone. Today, we're excited to introduce a tool designed to simplify and streamline this process: the React WAR Generator . What is the React WAR Generator? The React WAR Generator is a Python-based tool that automates the creation of WAR (Web Application Archive) files for Java web applications. It caters specifically to frontend projects built with React or similar frameworks, making it easier to package and deploy your web applications to a Tomcat server. Key Features Profile-Based Builds : With support for multiple profiles ( dev , test , prod , default ), you can build your application according to different environments and configurations. Version File Generation : Optionally generate a version file that integrates versioning information directly into your TypeScript files, ensuring your build versions are always up-to-date. Tomcat Deployment : Simplify your deploy...

How to Bypass Right Click Block on Any Website

In order to block the right-click activity, most websites make use of JavaScript which is one of the popular scripting languages used to enhance functionality, improve user experience and provide rich interactive features. In addition to this, it can also be used to strengthen the website’s security by adding some of the simple security features such as  disabling right-click ,  protecting images ,  hiding or masking parts of a web page  and so on. How JavaScript Works? Before you proceed to the next part which tells you how to disable the JavaScript functionality and bypass any of the restrictions imposed by it, it would be worthwhile for you to take up a minute to understand how JavaScript works. JavaScript is a client side scripting language (in most cases), which means when loaded it runs from your own web browser. Most modern browsers including IE, Firefox, Chrome and others support JavaScript so that they can interpret the code and carry out action...

C++ Program to implement File Handling With Class Objects

Q32. Program to implement File Handling With Class Objects: Define a class to represent a bank account. Include the following members:   i) Depositor Name  ii) Account Number iii) Balance Amount Member Function   i) To Assign Initial values(opening balance Rs. 1000 by default)  ii) To deposit an amount iii) To withdraw an amount(if possible) iv) To display the current balance Write a file based program to store the records of at least ten accounts in “ACCOUNT_DETAIL” data file and perform the required manipulations- DEPOSIT, WITHDRAW & BAL_ENQUIRY using the file on a given account. The changes after each deposit and withdrawal should be updated in the given file. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 7...

Samsung mobile cheat codes

* Software version: *#9999# * IMEI number: *#06# * Serial number: *#0001# * Battery status- Memory capacity : *#9998*246# * Debug screen: *#9998*324# – *#8999*324# * LCD kontrast: *#9998*523# * Vibration test: *#9998*842# – *#8999*842# * Alarm beeper – Ringtone test : *#9998*289# – *#8999*289# * Smiley: *#9125# * Software version: *#0837# * Display contrast: *#0523# – *#8999*523# * Battery info: *#0228# or *#8999*228# * Display storage capacity: *#8999*636# * Display SIM card information: *#8999*778# * Show date and alarm clock: *#8999*782# * The display during warning: *#8999*786# * Samsung hardware version: *#8999*837# * Show network information: *#8999*638# * Display received channel number and received intensity: *#8999*9266# * *#1111# S/W Version * *#1234# Firmware Version * *#2222# H/W Version * *#8999*8376263# All Versions Together * *#8999*8378# Test Menu * *#4777*8665# GPSR Tool * *#8999*523# LCD Brightness * *#8999*377# Error LOG Menu *...

download Code blocks 13.12 mingw.setup .exe 97 mb

NOTE: A newer version is been updated on the site ... visit here  http://vastgk.blogspot.com/2017/07/download-code-blocks-1601-mingwsetup.html File Date Download from codeblocks-13.12-setup.exe 27 Dec 2013 BerliOS  or  Sourceforge.net codeblocks-13.12mingw-setup.exe 27 Dec 2013 BerliOS  or  Sourceforge.net codeblocks-13.12mingw-setup-TDM-GCC-481.exe 27 Dec 2013 BerliOS  or  Sourceforge.net NOTE : The codeblocks-13.12mingw-setup.exe file  includes  the GCC compiler and GDB debugger from  TDM-GCC  (version 4.7.1, 32 bit). The codeblocks-13.12mingw-setup-TDM-GCC-481.exe file includes the TDM-GCC compiler, version 4.8.1, 32 bit. While v4.7.1 is rock-solid (we use it to compile C::B), v4.8.1 is provided for convenience, there are some known bugs with this version related to the compilation of Code::Blocks itself. IF UNSURE, USE "codeblocks-13.12mingw-setup.exe"!  \ Linux 32-bit: Dis...

just more way to disable autorun.inf

Auto run.Inf this is a instruction file associated with the Auto run function. It is a simple text configuration file that instructs the OS (operating system) which executable to start which icon to use which additional menu commands to make available etc Auto run.inf must be located in the root directory of a volume.That is CD,DVD,of Floppy Disk or Pen drive. It is mainly used by the manufacturer on what actions to taken when their CD-ROM when it is inserted. In OS, when autorun.inf is enabled (Normally by default it is enabled ) then by inserting the Cd or DVD the content of the medium is automatically executed. This is to avoid the user intervention and help the low level knowledge of computer literacy people. But Virus programmer taken this as advantage and make virus instruction in autorun.inf text file. TYPICAL AUTORUN.INF A typical autorun.inf file looks like below. [autorun] open=setup.exe icon=setup.exe,0 label=GameProgram SIMPLE METHOD NOT TO GET INFECTED BY AUTORUN.INF:...

how to Send a Confirmation Email Upon Form Submission-Woofoo

When someone successfully submits an entry, you can automatically send them a confirmation email to let them know. You can customize the email to include any follow-up info you'd like, and you can choose to include a copy of their entry in the email as well. To set up confirmation emails in Form Settings: Log in and go to  Forms . Hover over  Edit  next to the form you want to edit. Choose  Edit form . Click the  Form Settings  tab. Under Confirmation Options, select  Send Confirmation Email to User . From the  Send To  dropdown, select an Email field from your form. We'll send the confirmation email to the email address the person filling out your form entered into this field. If the dropdown says "No Email Fields Found", add an  Email  field to your form. In the  Reply To  textbox, enter the reply-to email—if someone replies to their confirmation email, this is the email address that their reply will be s...