Ejemplo n.º 1
0
Email: [email protected]

Version: 1.0

Description:

Help:
'''
from model.account import account
from model.atm import atm
import conf
import libs.mylib as mylib
if __name__ == '__main__':
    ac = account()
    atm = atm()
    # import re
    # amount_re = re.compile('^\d+[.]{0,1}\d+$')
    logger = mylib.mylog(conf.ATM_LOG)

    def print_menu(menu_list):
        '''
        输出菜单函数,用于显示菜单和获取用户输入
        :param menu_list: 菜单列表
        :return: 返回用户输入的选项
        '''
        for item in enumerate(menu_list, 1):
            print('%s、 %s' %item) # 通过遍历打印菜单项
        chose = input('请选择:').strip() # 获取用户输入
        return chose #返回用户输入
Ejemplo n.º 2
0
Version: 1.0

Description:

Help:
'''
# import logging
# import logging.config
from model.account import account
from model.atm import atm
import conf
import libs.mylib as mylib
if __name__ == '__main__':
    ac = account()
    atm = atm()
    # logging.config.fileConfig("atm_logger.conf")
    logger = mylib.mylog(conf.ATM_LOG)
    # handler = logging.FileHandler(filename='atm.log',encoding = "UTF-8")
    # logger.addHandler(handler)
    # logging.basicConfig(level=logging.DEBUG, format = u'%(asctime)s [%(levelname)s]: %(message)s', datefmt='%Y-%m-%d %H:%M:%S', filename='atm.log', filemode='a', encoding = "UTF-8")

    def print_welcome():
        # menu = ['查看详细信息', '查看账单', '提现', '同行转账', '查看消费流水', '修改密码', '退出']
        #account = atm.get_crurrent()
        #print(account)
        welcome_info = '''
**********************************
* %s *
* %s *
* %s *