Mã Python đơn giản cho Hệ thống Ngân hàng

Hệ thống quản lý ngân hàng Python – Trong bài viết này, tôi đã giải thích cách phát triển dự án hệ thống quản lý ngân hàng trực tuyến bằng python. Tôi đã nói với python là ngôn ngữ lập trình số một. Tối đa sinh viên đại học làm dự án của họ bằng ngôn ngữ python

Mã Python đơn giản cho Hệ thống Ngân hàng

Ngoài bài đăng này, bạn có thể thử kiếm tiền trực tuyến bằng công việc bán thời gian tại nhà của mình. Công việc rất dễ dàng như Khảo sát trực tuyến trên trang web (Tối thiểu $3 mỗi ngày) mà không cần đầu tư

Ngành ngân hàng đang rất cần dự án. Vì nó cần mức độ bảo mật cao để không ai hack các khoản thanh toán ngân hàng. Hầu hết các nhà phát triển & công ty chọn java cho dự án ngân hàng. Điều này chỉ rất an toàn cho các giao dịch thanh toán, UPI, v.v.

Tạo dự án

Trước khi bắt đầu dự án này, tôi giới thiệu một số ngôn ngữ lập trình khác. Khi chúng tôi sử dụng php cho các dự án của mình, nó không an toàn cho khách hàng của chúng tôi. Có khả năng rò rỉ. Đó là đây chọn python cho dự án ngân hàng. Mã Java cũng là ngôn ngữ lập trình được đề xuất cho các ứng dụng liên quan đến thanh toán. Tạo tệp mới và thêm đoạn mã sau,

import pickle
import os


"""*****************************************************************************
                            CLASS USED IN PROJECT
*****************************************************************************"""

class account(object):
    def __init__(s):
        s.acno=0
        s.name=""
        s.deposit=0
        s.type=""

    def create_account(s):  #function to get data from user
        name=raw_input("\n\nEnter the name of the account holder: ")
        s.name=name.capitalize()
        type=raw_input("\nEnter type of the account (C/S): ")
        s.type=type.upper()
        s.deposit=input("\nEnter initial amount\n(>=500 for Saving and >=1000 for Current): ")
        
    def show_account(s):    #function to show data on screen
        print "\nAccount No. :", s.acno
        print "\nAccount holder name: ", s.name
        print "\nType of account", s.type
        print "\nBalance amount: ", s.deposit

    def modify(s):          #function to get new data from user
        print "\nAccount No. : ", s.acno
        s.name=raw_input("\n\nEnter the name of account holder: ")
        type=raw_input("\n\nEnter type of account (C/S): ")
        s.type=type.upper()
        s.deposit=input("\nEnter the amount: ")

    def dep(s,x):           #function to accept amount and add to balance
        s.deposit+=x

    def draw(s,x):          #function to accept amount and subtract from balance amount
        s.deposit-=x

    def report(s):          #function to show data in tabular format
        print "%-10s"%s.acno,"%-20s"%s.name,"%-10s"%s.type,"%-6s"%s.deposit

    def retacno(s):         #function to return account number
        return s.acno

    def retdeposit(s):      #function to return balance amount 
        return s.deposit

    def rettype(s):         #function to return type of account
        return s.type


"""*****************************************************************************
                    FUNCTION TO GENERATE ACCOUNT NUMBER
*****************************************************************************"""

def gen_acno():
    try:
        inFile=open("account2.dat","rb")
        outFile=open("text2.dat","wb")
        n=inFile.read()
        n=int(n)
        while True:
            n+=1
            outFile.write(str(n))
            inFile.close()
            outFile.close()
            os.remove("account2.dat")
            os.rename("text2.dat","account2.dat")
            yield n
            
    except IOError:
        print "I/O error occured"


"""*****************************************************************************
                    FUNCTION TO WRITE RECORD IN BINARY FILE
*****************************************************************************"""

def write_account():
    try:
        ac=account()
        outFile=open("account.dat","ab")
        ch=gen_acno()
        ac.acno=ch.next()
        ac.create_account()
        pickle.dump(ac,outFile)
        outFile.close()
        print "\n\n Account Created Successfully"
        print "\n\n YOUR ACCOUNT NUMBER IS: ",ac.retacno()
    except:
        pass


"""*****************************************************************************
                FUNCTION TO DISPLAY ACCOUNT DETAILS GIVEN BY USER
*****************************************************************************"""

def display_sp(n):
    flag=0
    try:
        inFile=open("account.dat","rb")
        print "\nBALANCE DETAILS\n"
        while True:
            ac=pickle.load(inFile)

            if ac.retacno()==n:
                ac.show_account()
                flag=1
                
    except EOFError:
        inFile.close
        if flag==0:
            print "\n\nAccount number not exist"

    except IOError:
        print "File could not be open !! Press any Key..."


"""*****************************************************************************
                        FUNCTION TO MODIFY RECORD OF FILE
*****************************************************************************"""

def modify_account(n):
    found=0
    try:
        inFile=open("account.dat","rb")
        outFile=open("temp.dat","wb")
        while True:
            ac=pickle.load(inFile)
            if ac.retacno()==n:
                print 30*"-"
                ac.show_account()
                print 30*"-"
                print "\n\nEnter The New Details of Account"
                ac.modify()
                pickle.dump(ac,outFile)
                print "\n\n\tRecord Updated"
                found=1
            else:
                pickle.dump(ac,outFile)
             
    except EOFError:
        inFile.close()
        outFile.close()
        if found==0:
            print "\n\nRecord Not Found "

    except IOError:
        print "File could not be open !! Press any Key..."

    os.remove("account.dat")
    os.rename("temp.dat","account.dat")


"""*****************************************************************************
                    FUNCTION TO DELETE RECORD OF FILE
*****************************************************************************"""

def delete_account(n):
    found=0

    try:
        inFile=open("account.dat","rb")
        outFile=open("temp.dat","wb")
        while True:
            ac=pickle.load(inFile)
            if ac.retacno()==n:
                found=1
                print "\n\n\tRecord Deleted .."
            else:
                pickle.dump(ac,outFile)

    except EOFError:
        inFile.close()
        outFile.close()
        if found==0:
            print "\n\nRecord Not Found"

    except IOError:
        print "File could not be open !! Press any Key..."

    os.remove("account.dat")
    os.rename("temp.dat","account.dat")


"""*****************************************************************************
                    FUNCTION TO DISPLAY ALL ACCOUNT DETAILS
*****************************************************************************"""

def display_all():
    print "\n\n\tACCOUNT HOLDER LIST\n\n"
    print 60*"="
    print "%-10s"%"A/C No.","%-20s"%"Name","%-10s"%"Type","%-6s"%"Balance"
    print 60*"=","\n"
    try:
        inFile=open("account.dat","rb")
        while True:
            ac=pickle.load(inFile)
            ac.report()
            
    except EOFError:
        inFile.close()
        
    except IOError:
        print "File could not be open !! Press any Key..."


"""*****************************************************************************
            FUNCTION TO DEPOSIT/WITHDRAW AMOUNT FOR GIVEN ACCOUNT
*****************************************************************************"""

def deposit_withdraw(n,option):
    found=0

    try:
        inFile=open("account.dat","rb")
        outFile=open("temp.dat","wb")
        while True:
            ac=pickle.load(inFile)
            if ac.retacno()==n:
                ac.show_account()
                if option==1:
                    print "\n\n\tTO DEPOSIT AMOUNT"
                    amt=input("Enter the amount to be deposited: ")
                    ac.dep(amt)
                elif option==2:
                    print "\n\n\tTO WITHDRAW AMOUNT"
                    amt=input("Enter amount to be withdraw: ")
                    bal=ac.retdeposit()-amt
                    if((bal<500 and ac.rettype()=="S")or(bal<1000 and ac.rettype()=="C")):
                        print "Insufficient balance"
                    else:
                        ac.draw(amt)
                pickle.dump(ac,outFile)
                found=1
                print "\n\n\tRecord Updated"
            else:
                pickle.dump(ac,outFile)
                
    except EOFError:
        inFile.close()
        outFile.close()
        if found==0:
            print "\n\nRecord Not Found"
    
    except IOError:
        print "File could not be open !! Press any Key..."

    os.remove("account.dat")
    os.rename("temp.dat","account.dat")


"""*****************************************************************************
                        INTRODUCTORY FUNCTION
*****************************************************************************"""

def intro():
    print "\n\n\tBANK"
    print "\n\tMANAGEMENT"
    print "\n\n\nMADE BY : Enter your name"
    print "\nSCHOOL : Enter your school name"


"""*****************************************************************************
                        THE MAIN FUNCTION OF PROGRAM
*****************************************************************************"""

intro()

while True:
    print 3*"\n",60*"="
    print """MAIN MENU
    1. New Account
    2. Deposit Amount
    3. Withdraw Amount
    4. Balance Enquiry
    5. All Account Holder List
    6. Close An Account
    7. Modify An Account
    8. Exit
    """

    try:
        ch=input("Enter Your Choice(1~8): ")
        if ch==1:
            write_account()
        
        elif ch==2:
            num=input("\n\nEnter Account Number: ")
            deposit_withdraw(num,1)

        elif ch==3:
            num=input("\n\nEnter Account Number: ")
            deposit_withdraw(num,2)

        elif ch==4:
            num=input("\n\nEnter Account Number: ")
            display_sp(num)

        elif ch==5:
            display_all()

        elif ch==6:
            num=input("\n\nEnter Account Number: ")
            delete_account(num)
        
        elif ch==7:
            num=input("\n\nEnter Account Number: ")
            modify_account(num)

        elif ch==8:
            break

        else:
            print "Input correcr choice...(1-8)"

    except NameError:
        print "Input correct choice...(1-8)"



raw_input("\n\n\n\n\nTHANK YOU\n\nPress any key to exit...")

Chạy dự án

Chọn IDE yêu thích của bạn và sao chép mã ở trên. Để thực hiện dự án theo lệnh

tên tệp $ python. py

Hệ thống quản lý ngân hàng Python

Hi vọng source code này sẽ giúp các bạn phát triển đồ án hệ thống quản lý ngân hàng trực tuyến bằng python. Thông qua Python, chúng ta có thể phát triển cả ứng dụng web và ứng dụng di động

Python có thể được sử dụng trong ngân hàng không?

Python có thể được sử dụng để tạo ra các giải pháp phần mềm ngân hàng an toàn và có khả năng mở rộng cực cao . Python được sử dụng trong ngành ngân hàng để hỗ trợ cả ứng dụng trực tuyến và ngoại tuyến. Python đã được sử dụng để tạo và duy trì một số lượng lớn các cổng thanh toán.

Làm cách nào để tạo dự án hệ thống quản lý ngân hàng bằng Python?

Trong dự án này, Dự án Python Hệ thống quản lý ngân hàng sử dụng Tkinter, người dùng có thể tạo tài khoản bằng cách nhập thông tin như tên người dùng, số dư mở và số pin< . Sau đó, người dùng phải gửi những dữ liệu đó để có quyền truy cập vào tài khoản của họ. . The user must then submit those data in order to gain access to their account.

Hệ thống ngân hàng trong Python là gì?

Hệ thống ngân hàng sử dụng Python. Mã này cho phép người dùng quản lý hiệu quả mọi giao dịch của khách hàng một cách dễ dàng . Mục đích chính của hệ thống này là mô phỏng quản lý giao dịch của khách hàng để Ngân hàng duy trì hồ sơ chi tiết và để Khách hàng của Ngân hàng thực hiện Giao dịch.

Một số dự án Python cho người mới bắt đầu là gì?

Ý tưởng dự án Python. Cấp độ mới bắt đầu .
Tạo trình tạo mã. .
Xây dựng một máy tính đếm ngược. .
Viết phương pháp sắp xếp. .
Xây dựng một bài kiểm tra tương tác. .
Tic-Tac-Toe bằng văn bản. .
Tạo bộ chuyển đổi nhiệt độ/đo lường. .
Xây dựng một ứng dụng truy cập. .
Xây dựng trò chơi đoán số