上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 42 下一页
摘要: 千万不要被所谓“元类是99%的python程序员不会用到的特性”这类的说辞吓住。因为每个中国人,都是天生的元类使用者 学懂元类,你只需要知道两句话: 道生一,一生二,二生三,三生万物 我是谁?我从哪来里?我要到哪里去? 道生一,一生二,二生三,三生万物 我是谁?我从哪来里?我要到哪里去? 在pyth 阅读全文
posted @ 2017-11-05 09:45 howhy 阅读(1467) 评论(0) 推荐(0)
摘要: response.selector.xpath('//')#//从根开始匹配 .xpath('//img[@*])#找出所有img的所有属性 .xpath('//img/@src').extract()#找出所有img的src属性 .xpath('//a[@href='index.html']'). 阅读全文
posted @ 2017-10-28 21:09 howhy 阅读(168) 评论(0) 推荐(0)
摘要: 用pyenv 和 virtualenv 搭建单机多版本python 虚拟开发环境 作为主流开发语言, 用python 开发的程序越来越多。 方便的是大多linux系统里面都默认集成了python, 开发可以随时随地开始。 但有时候这也成为了一个短板, 比如说有时候我们需要开发和调试一些需要安装在默认 阅读全文
posted @ 2017-10-27 18:58 howhy 阅读(276) 评论(0) 推荐(0)
摘要: linux shell启动:celery -A celery_study worker --loglevel=info linux shell#cd 到celery_study.py的目录 执行python >>from celery_study import add >>add.delay(3,4 阅读全文
posted @ 2017-10-27 13:33 howhy 阅读(275) 评论(1) 推荐(0)
摘要: yum install -y epel-release yum install -y redis vim /etc/redis.conf 修改:bind 0.0.0.0 requirepass foobared123 systemctl restart redis redis-cli >>auth  阅读全文
posted @ 2017-10-26 18:20 howhy 阅读(301) 评论(0) 推荐(0)
摘要: 操作: 后台shell命令: 执行mongo进入 help查看帮助命令 use test数据库 然后插入一条数据 数据库test才会创建 db.help;查看db命令 db.createUser({user:'dba',pwd:'123456',roles: [ { role: "userAdmin 阅读全文
posted @ 2017-10-26 09:50 howhy 阅读(185) 评论(0) 推荐(0)
摘要: 不可变类型是可hash #tuple str freezeset 可变类型是不可hash ##list set 阅读全文
posted @ 2017-10-25 22:51 howhy 阅读(2215) 评论(0) 推荐(0)
摘要: l:local e:enclosing g:global b:buitl-in 函数变量有作用域 if else while 变量没有作用域 不能修改全局变量 若要修改需加global 阅读全文
posted @ 2017-10-25 22:36 howhy 阅读(227) 评论(0) 推荐(0)
摘要: centos 6.x Python2.7x安装 yum install -y gcc gcc-develwget https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tgztar xf Python-2.7.14.tgzcd /root/Py 阅读全文
posted @ 2017-10-23 13:34 howhy 阅读(180) 评论(0) 推荐(0)
摘要: import logging #logging.basicConfig(level=logging.DEBUG, # format='[line:%(lineno)d] %(asctime)s %(levelname)s %(message)s', # datefmt='%a,%Y %b %d %H:%M:%S', ... 阅读全文
posted @ 2017-10-21 11:16 howhy 阅读(216) 评论(0) 推荐(0)
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 42 下一页