码迷,mamicode.com
首页 >  
搜索关键字:def    ( 28626个结果
(七)注册Flask命令(使用click模块)
1.添加装饰器 @app.cli.command() def hello(): click.echo('Hello, Human!click Fun.') 注册了flask命令:即函数名:hello,执行:flask hello 来触发执行 传入自定义命令:@app.cli.command('abc ...
分类:其他好文   时间:2021-03-29 12:32:45    阅读次数:0
Python根据csv某列数据操作某一后缀的文件
# coding=gbk import os import csv import pandas as pd import shutil # 获取指定文件夹中后缀.svs的文件 def get_svsfile(path_svs): f_list = os.listdir(path_svs) for i ...
分类:编程语言   时间:2021-03-29 12:14:06    阅读次数:0
robot 源码解读1
先看看多少代码量 import os file_types = ['py', 'html', 'css', 'js', ] def count_code_nums(file): """获取单个文件的行数 """ with open(file, mode='rb') as f: return len( ...
分类:其他好文   时间:2021-03-29 12:13:33    阅读次数:0
python 基于元类的单例
创建元类的基类(Singleton) ` from threading import RLock class SingletonType(type): single_lock = RLock() def __call__(cls, *args, **kwargs): with SingletonTy ...
分类:编程语言   时间:2021-03-29 11:54:40    阅读次数:0
装饰器
装饰器 定义:是在不改变函数的调用方式,还能为此函数前后添加功能 装饰器的形成过程 一、写一个测试代码时间的函数 import time#导入time模块是为了模拟函数运行时间 def inner(): start=time.time() time.sleep(1) for i in range(1 ...
分类:其他好文   时间:2021-03-29 11:52:53    阅读次数:0
python-多任务编程-进程池应用
示例代码如下: import multiprocessing import time import json def buy_ticket(lock): # 1.获取余票 time.sleep(1) lock.acquire() data = json.load(open('ticket.json' ...
分类:编程语言   时间:2021-03-26 15:31:36    阅读次数:0
线性回归和量化交易基础(下)
使用回归法选股, 和之前选取的因子是一样的 def regression_select(context,bar_dict): # 查询因子数据 q=query(fundamentals.eod_derivative_indicator.pe_ratio, fundamentals.eod_deriv ...
分类:其他好文   时间:2021-03-26 15:19:28    阅读次数:0
python3.6 安装uwsgi报错处理
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. Please see https://github.com/pypa/pip/issues/5599 ...
分类:编程语言   时间:2021-03-18 14:13:35    阅读次数:0
C++Learn01--宏替换的注意事项
理解宏定义的关键在于”替换“ 该命令有两种格式:一种是简单的宏定义,另一种是带参数的宏定义 《1》简单的宏定义: #define 宏名 字符串 《2》带参数的宏定义 #define 宏名(参数表) 宏体 错误示范: #define Square(x) x*x float teamp=Square(3 ...
分类:编程语言   时间:2021-03-18 14:05:14    阅读次数:0
递归存储二叉树和遍历二叉树
#include<stdio.h> #include<stdlib.h> typedef char ElemType; //结点定义 typedef struct node{ ElemType data; struct node* lchild,*rchild; }BiTNode,*BiTree; ...
分类:其他好文   时间:2021-03-17 14:03:43    阅读次数:0
28626条   上一页 1 ... 37 38 39 40 41 ... 2863 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!