예제 #1
0
                        input('已取消删除1个%s,\n按任意键继续' %goods_name)
                        break
                    else:
                        print('输入错误,请重新输入')
                pass
            else:
                input("输入错误,按任意键继续")
        else:
            input("输入错误,按任意键继续")



if __name__ == '__main__':
    # 程序主入口
    # 创建购物车对象
    goods = goods(conf.goods_file)
    # 常见客户对象
    customer = customer(conf.customer_file)
    print(conf.app_info)
    print('请先登录:')
    # 调用客户对象的authenticate()进行登录验证
    if customer.authenticate():
        # 登录成功
    #if True:
        # 获取当前用户信息
        current_user_info = customer.get_current_customer_info()
        flag = True
        while flag:
            # 打印主菜单
            print_main_menu()
            # 获取输入的菜单编号
예제 #2
0
Version: 2.0

Description: 65商城主程序

Help:
'''
from model.customer import customer
from model.shopping import shopping
from model.goods import goods
from model.atm import atm
from libs import mylib
import conf

if __name__ == '__main__':
    shopping = shopping()
    goo = goods()
    logger = mylib.mylog(conf.SHOPPING_LOG)
    cu = customer()
    atm = atm()

    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  #返回用户输入
예제 #3
0
Description: 65商城主程序

Help:
'''
from model.customer import customer
from model.shopping import shopping
from model.goods import goods
from model.atm import atm
from libs import mylib
import conf


if __name__ == '__main__':
    shopping = shopping()
    goo = goods()
    logger = mylib.mylog(conf.SHOPPING_LOG)
    cu = customer()
    atm = atm()
    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 #返回用户输入

    def print_welcome():
예제 #4
0
                        # 用户输入n取消删除
                        input('已取消删除1个%s,\n按任意键继续' % goods_name)
                        break
                    else:
                        print('输入错误,请重新输入')
                pass
            else:
                input("输入错误,按任意键继续")
        else:
            input("输入错误,按任意键继续")


if __name__ == '__main__':
    # 程序主入口
    # 创建购物车对象
    goods = goods(conf.goods_file)
    # 常见客户对象
    customer = customer(conf.customer_file)
    print(conf.app_info)
    print('请先登录:')
    # 调用客户对象的authenticate()进行登录验证
    if customer.authenticate():
        # 登录成功
        #if True:
        # 获取当前用户信息
        current_user_info = customer.get_current_customer_info()
        flag = True
        while flag:
            # 打印主菜单
            print_main_menu()
            # 获取输入的菜单编号