2018年3月29日

Mac 命令行安装mysql homebrew 安装mysql后,如何配置mysql

摘要: 非常好 强力推荐 这个是我最新并且一直推崇的方法:1、安装:sunyichaodeMacBook-Pro:~ sunyichao$ brew install mysql2、开启mysql:mysql.server start2、使用mysql的配置脚本:/usr/local/opt/mysql/bi 阅读全文

posted @ 2018-03-29 18:59 星河赵 阅读(355) 评论(0) 推荐(0) 编辑

python 将字符串转换为字典

摘要: json越来越流行,通过python获取到json格式的字符串后,可以通过eval函数转换成dict格式: >>> a='{"name":"yct","age":10}' >>> eval(a) {'age': 10, 'name': 'yct'} >>> a='{"name":"yct","age 阅读全文

posted @ 2018-03-29 15:26 星河赵 阅读(219) 评论(0) 推荐(0) 编辑

python 高阶函数 map lambda filter等

摘要: map 描述 map() 会根据提供的函数对指定序列做映射。 第一个参数 function 以参数序列中的每一个元素调用 function 函数,返回包含每次 function 函数返回值的新列表。 map计算两个列表各个元素的平方 提供两个列表对相同位置的元素相加 阅读全文

posted @ 2018-03-29 14:31 星河赵 阅读(150) 评论(0) 推荐(0) 编辑

python 类的使用实例方法

摘要: class A: dict_1 = 456 def __init__(self): self.dict_1 = 'abcdsafdsf' #当增加@staticmethod 时为类方法 @staticmethod def edf(): print '\nstatic method edf' #为实例方法 a = ... 阅读全文

posted @ 2018-03-29 11:28 星河赵 阅读(215) 评论(0) 推荐(0) 编辑

导航