摘要:
1. 对数字和字符串而言,浅拷贝和深拷贝没有意义,都是指向同一内存地址。 2. 浅拷贝,在内存中只额外创建第一层数据 3. 深拷贝 深拷贝,在内存中将所有的数据重新创建一份(排除最后一层,即:python内部对字符串和数字的优化) 阅读全文
摘要:
格式: lambda x: x * x 关键字lambda表示匿名函数,冒号前面的x表示函数参数。 匿名函数有个限制,就是只能有一个表达式,不用写return,返回值就是该表达式的结果。 用匿名函数有个好处,因为函数没有名字,不必担心函数名冲突。此外,匿名函数也是一个函数对象,也可以把匿名函数赋值给 阅读全文
摘要:
1、 生成器 生成器是一种特殊的迭代器,它的定义更加优雅,它不需要像迭代器那样定义定义__iter__和__next__方法。 生成器分为2种形式: 2、迭代器 可以被next()函数调用并不断返回下一个值的对象称为迭代器:Iterator,全部取出后, 会引发一个 StopIteration 异常 阅读全文
摘要:
A cookie is a small piece of data sent by a website to your browser. It helps the website to remember information about your visit, like your country 阅读全文
摘要:
open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None) Open file and return a corresponding file obje 阅读全文
摘要:
1、基于ip和端口的虚拟主机 server { listen 192.168.56.101:80; } 2、基于域名的虚拟机主机 server {server_name www.example.com; } 3. server 上下文常用指令 3.1 root 由于定义 location uri 对 阅读全文
摘要:
1.创建git可以管理的仓库 #切换到要创建仓库的目录$ mkdir gittest$ cd gittest/ #创建git仓库$ git initInitialized empty Git repository in C:/gittest/.git/ $ ls -a./ ../ .git/ $ l 阅读全文
摘要:
Tutorial : Implementing Django Formsets Tutorial : Implementing Django Formsets A step-by-step tutorial for setting up and testing a standard Django f 阅读全文