Quota 15000
Can withdraw, handling fee%5
Last day of the month (30 days per month), write to File
Record daily consumption flow (trading day, transaction summary, amount)
Provide repayment interface
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/D5/wKiom1WJJ3vQWDqcAAKBd4d6pzM197.jpg "title=" capture. PNG "alt=" Wkiom1wjj3vqwdqcaakbd4d6pzm197.jpg "/>
Main program bill_main_models.py#coding:utf-8import sysimport datetimeimport timedef withdraw_ Mode (limit): f_file = ' Bill_detail.txt ' try: num = int (Raw_input (' please input your Withdraw number: ') except: print ' Please input a valid number ' # continue Not in circulation sys.exit () true_num = num + num * 0.05 if true_num <= limit: print ' ok,give you the money ' limit = limit - true_num print ' now you have ', Limit item = str (Datetime.date.today ()) + ' ' + ' withdraw ' + ' ' + str (True_num) f = file (F_file, ' a ') f.write (item) f.write (' \ n ') f.close () return limit else: print ' You want too much money,now you have ', Limit def pay_by_card_mode (limit): f_file = ' Bill_detail.txt ' try: name = rAw_input (' please input your product name: ') num = int (Raw_input (' Please input your product money: ')) except: print ' Please input a valid name or number ' sys.exit () if num <= limit: print ' Ok,you get it ' limit = limit - num print ' now you have ',limit item = str (Datetime.date.today ()) + ' ' + ' Pay_by_card ' + ' ' + str (num) f = file (F_file, ' a ') f.write (item) f.write (' \ n ') f.close () return limit else: print ' you want too much money,now you have ', Limit def repayment_mode (limit): f_file = ' Bill_detail.txt ' try: num = int (Raw_input (' Please input your back money: ')) except: print ' please input a Valid number ' sys.exit () print ' OK,YOU&NBSp;back it ' limit = limit + num print ' now you have ', Limit item = str (Datetime.date.today ()) + ' ' + ' repayment ' + ' ' + str (num) f = file (F_file, ' a ') f.write (item) f.write (' \ n ') f.close () return limit limit = 15000 #这应该写在文件里的while True: print ' 1 withdraw2 pay by card3 repayment4 exit ' try: choose = int (Raw_input (' Please input your number: ')) except: print ' please input a Valid number ' continue if choose == 1: limit = withdraw_mode (limit) elif Choose == 2: limit = pay_by_card_mode (limit ) elif choose == 3: limit = repayment_mode (limit) elif choose == 4: sys.exit () else: print ' Please input a valid number ' continue Transfers Procedure bill_mon_sum.py#coding:UTF-8import datetimeimport timeimport Sysdef mon_sum (Bill_card): s = 0 for i in bill_card: i = float (i) s = s + i return swhile True: if datetime.date.today (). Strftime ('%d ') == ': ' pay_by_card_mon = [] withdraw_mon = [] repayment_mon = [] f_file = ' Bill_detail.txt ' f = file (F_file) for line in F.readlines (): line = Line.strip (). Split () if line[1] == ' Pay_by_card ': pay_by_card_mon.append (Line[2]) elif line[1] == ' Withdraw ': Withdraw_mon.append (line[2]) elif line[1] == ' repayment ': repayment_mon.append (line[2]) else: print ' this bill is no defiened ' pass f.close () &NBSP;&NBSP;&NBSP;&NBSP;&NBsp; pay_by_card_mon_sum = str (Datetime.date.today ()) + ' ' + ' Pay_by_card_mon ' + ' ' + str (Mon_sum (Pay_by_card_mon)) withdraw_mon_sum = str (Datetime.date.today ()) + ' ' + ' Withdraw_mon ' + ' ' + str (Mon_sum (Withdraw_mon)) repayment_mon_sum = str (Datetime.date.today ()) + ' ' + ' Repayment_mon ' + ' ' + str (Mon_sum (Repayment_mon)) f_file = ' Bill_mon.txt ' f = file (F_file, ' a ') f.write (pay_by_card_mon_sum) f.write (' \ n ') f.write ( Withdraw_mon_sum) f.write (' \ n ') f.write ( repayment_mon_sum) f.write (' \ n ') f.close () print ' 1111111111 ' time.sleep (60*60*24) else: print ' 222222 ' time.sleep (60*60*24 ) continue
Alex Instructional Video-credit card billing