随笔分类 - python习题
摘要:登录后跳转原页面 def login_auth(func_name): def inner(request, *args, **kwargs): # print(request.path) # print(request.path_info) # 1.获取用户没有登录之前想要访问的网址地址 targ
阅读全文
摘要:项目开发流程 # 公司中的项目流程几乎都可以分为以下五个步骤 '''假设我们是一家外包公司 专门给别人编写软件''' # 1.需求分析 产品经理带着开发部门老大(架构师、研发经理)去客户公司寻求客户的需求 见客户之前架构师和研发经理会先大致了解一下客户的需求 然后琢磨出一套比较容易编写的流程 之后在
阅读全文
摘要:import os import json # 获取执行文件所在路径 current_path = os.path.dirname(__file__) # 拼接db文件夹的路径 data_path = os.path.join(current_path, 'db') if not os.path.e
阅读全文
摘要:# 普通的求和函数 def add(n, i): return n + i # 生成器对象 返回 0 1 2 3 def test(): for i in range(4): yield i # 将test函数变成生成器对象 g = test() # 简单的for循环 for n in [1, 10
阅读全文
摘要:def my_range(a, b=None, c=1): if not b: b = a a = 0 while a < b: yield a a += c
阅读全文
摘要:# 多个函数被装饰后 只要有一次认证成功 之后就不需要认证 is_auth = {'is_login':False} def login_auton(func_name): def inner(*args, **kwargs): if is_auth.get('is_login'): res = f
阅读全文