上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 41 下一页
摘要: 操作: 后台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 阅读(174) 评论(0) 推荐(0)
摘要: 不可变类型是可hash #tuple str freezeset 可变类型是不可hash ##list set 阅读全文
posted @ 2017-10-25 22:51 howhy 阅读(2208) 评论(0) 推荐(0)
摘要: l:local e:enclosing g:global b:buitl-in 函数变量有作用域 if else while 变量没有作用域 不能修改全局变量 若要修改需加global 阅读全文
posted @ 2017-10-25 22:36 howhy 阅读(219) 评论(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 阅读(167) 评论(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 阅读(206) 评论(0) 推荐(0)
摘要: 首先在window的文件夹窗口输入 : %APPDATA% 然后在底下新建pip文件夹,然后到pip文件夹里面去新建个pip.ini,然后再里面输入内容 [global] timeout = 6000 index-url = http://pypi.douban.com/simple trusted 阅读全文
posted @ 2017-10-19 09:39 howhy 阅读(767) 评论(0) 推荐(0)
摘要: """ 1. makestrans()用法 语法: str.maketrans(intab, outtab]); Python maketrans() 方法用于创建字符映射的转换表,对于接受两个参数的最简单的调用方式, 第一个参数是字符串,表示需要转换的字符,第二个参数也是字符串表示转换的目标。 注:两个字符串的长... 阅读全文
posted @ 2017-10-18 16:31 howhy 阅读(577) 评论(0) 推荐(0)
摘要: 1、locals() 和 globals() 是python 的内建函数,他们提供了字典的形式访问局部变量和全局变量的方式。 示例代码: 输出为: 2、locals() 返回是当前局部变量的深拷贝,修改locals() 中变量值的时候,实际上对于原变量本身是没有任何影响的。而globals()返回的 阅读全文
posted @ 2017-10-17 19:57 howhy 阅读(567) 评论(0) 推荐(0)
摘要: 打印结果: One (in Thread-A) Two (in Thread-B) Main-Thread threading.local()这个方法的特点用来保存一个全局变量,但是这个全局变量只有在当前线程才能访问, localVal.val = name这条语句可以储存一个变量到当前线程,如果在 阅读全文
posted @ 2017-10-17 19:20 howhy 阅读(276) 评论(0) 推荐(0)
摘要: 线程;线程是计算机中工作的最小单元 io密集型 进程:默认有一个主线程,并且有多个线程,共享内部资源 计算密集型 协程:是一个线程,使用进程中的一个线程执行多个任务,微线程 阅读全文
posted @ 2017-10-15 17:08 howhy 阅读(143) 评论(0) 推荐(0)
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 41 下一页