摘要: linux1 master 10.10.10.70 linux2 slave 10.10.10.80 做主从是在从服务器也事先打开binglog、以及授权好各种用户。 基础环境(双机互联) [root@linux2 ~]# ssh-keygen [root@linux2 ~]# ssh-copy-i 阅读全文
posted @ 2016-09-03 13:58 xuanhui 阅读(335) 评论(0) 推荐(0) 编辑
摘要: >>> def func():... print("this is a func()")... >>> func()this is a func() 多个参数: >>> def add(a,b):... print(a+b)... >>> add(3,5)8 默认参数: >>> def add(a, 阅读全文
posted @ 2016-09-03 13:45 xuanhui 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 赋值引用,多变量使用同内存。对于可变数据对象,修改其中一个,影响其他。浅拷贝,只拷贝数据父对象,不拷贝其中子对象。深拷贝,拷贝对象及其子对象。 赋值引用:(修改,所有多影响) list1=[1,2,3] list2=list1 浅拷贝:(只拷贝第一层,其他的层公共) import copy list 阅读全文
posted @ 2016-09-03 11:54 xuanhui 阅读(108) 评论(0) 推荐(0) 编辑
摘要: >>> x = 100 >>> y = 10>>> x < y and x or y10>>> x if x > y else y100 if 语句: >>> x = 10>>> if x == 10:... print(x)... 10 >>> if x == 10:... print(x)... 阅读全文
posted @ 2016-09-03 11:30 xuanhui 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 算术表达式: 地板除: >>> 10 // 3 3>>> 5 // 2 2>>> 5 // 31 取余: >>> 10 % 31>>> 10 % 42 幂运算: >>> 4 ** 216 逻辑表达式: >>> x = 1>>> y = 0>>> not xFalse>>> not yTrue>>> 阅读全文
posted @ 2016-09-03 11:04 xuanhui 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 整形:(不可变类型) >>> a = 123>>> type(a)<class 'int'> 长整形:(在python3中已经废弃了) >>> a = 123L>>> type(a)<type 'long'> 浮点型: >>> c = 1.2>>> type(c)<class 'float'> 在p 阅读全文
posted @ 2016-09-03 10:33 xuanhui 阅读(112) 评论(0) 推荐(0) 编辑