09 2018 档案
摘要:可变参数允许你传入0个或任意个参数,这些可变参数在函数调用时自动组装为一个tuple。而关键字参数允许你传入0个或任意个含参数名的参数,这些关键字参数在函数内部自动组装为一个dictdef person(name,age,**kw): ...
阅读全文
摘要:def add1(*data): sum = 0 for i in data: sum = sum + i return sumprint( add1(1,2,3,4,5) )print( add1...
阅读全文
摘要:Python下一切皆对象,每个对象都有多个属性(attribute),Python对属性有一套统一的管理方案。__dict__与dir()的区别: dir()是一个函数,返回的是list; __dict__是一个字典,键为属性名,值为属性值; ...
阅读全文
摘要:class Student: count=0 def __init__(self,name,age): self.name=name self.age=age Student.count+=1 ...
阅读全文
摘要:sudo apt-get purge nvidia*reboot
阅读全文
摘要:#!/usr/bin/env python3# -*- coding: utf-8 -*-"""Created on Wed Sep 26 12:41:46 2018@author: luogan"""import numpy as npfrom matpl...
阅读全文
摘要:import numpy as npimport cv2from matplotlib import pyplot as pltimg=cv2.imread('tt.png',cv2.IMREAD_COLOR)#method1b,g,r=cv2.split(...
阅读全文
摘要:ubuntu安装opencv输入这里的make 代码采用这个框架删除
阅读全文
摘要:tartar命令可以用来压缩打包单文件、多个文件、单个目录、多个目录。常用格式:单个文件压缩打包 tar czvf my.tar file1多个文件压缩打包 tar czvf my.tar file1 file2,...单个目录压缩打包 tar czvf m...
阅读全文
摘要:scp命令的实际应用概述: 从本地服务器复制到远程服务器:(1) 复制文件: 命令格式: scp local_file remote_username@remote_ip:remote_folder 或者 scp local_file remote_user...
阅读全文
摘要:condition="select * from choice_dailyfinancehistory where f_code_id='212' and f_date < '2016-01-24 08:00:00+08'"
阅读全文
摘要:原文root@ubuntu:/usr/local/redis/bin# ./redis-cli127.0.0.1:6379> config set stop-writes-on-bgsave-error noOK127.0.0.1:6379> lpush m...
阅读全文
摘要:/etc/init.d/redis-server stop/etc/init.d/redis-server start/etc/init.d/redis-server restart
阅读全文
摘要:import pytz def get_weekend(tt): from dateutil.parser import parse bb=parse(tt) pacific = pytz.timezone('Asia/Shangha...
阅读全文