1.wget https://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz --no-check-certificate2. #chmod +x pip-1.3.1.tar.gz #tar xzvf pip-1.3.1.tar.gz ....
分类:
编程语言 时间:
2014-09-06 00:59:12
阅读次数:
237
Python中的random模块用于生成随机数。下面介绍一下random模块中最常用的几个函数。
random.random
random.random()用于生成一个0到1的随机符点数: 0
random.uniform
random.uniform的函数原型为:random.uniform(a, b),用于生成一个指定范围内的随机符点数,两个参数其中一个是上限,一...
分类:
编程语言 时间:
2014-09-05 23:53:52
阅读次数:
473
Last login: Sun Aug 10 21:07:51 on ttys001SandymatoMacBook-Pro:MySQL-python-1.2.4b4 sandy$ sudo python setup.py buildrunning buildrunning build_pycopy...
分类:
数据库 时间:
2014-09-05 23:43:02
阅读次数:
313
Python dictionaries are implemented ashash tables.Hash tables must allow forhash collisionsi.e. even if two keys have same hash value, the implementat...
分类:
编程语言 时间:
2014-09-05 22:21:42
阅读次数:
607
1.windows下安装python官网下载安装即可2.安装后的环境设置我的电脑--属性--高级--设置path的地方添加python安装目录,如C:\Python27;C:\Python333.多版本的切换三种方法:1)修改C:\Python27;C:\Python33内python.exe为py...
分类:
编程语言 时间:
2014-09-05 21:02:11
阅读次数:
509
#-*-coding:utf-8-*-#python:2.x__author__='Administrator'importasynchat,asyncore,logging,socket#asyncore异步IO#作用:异常IO处理#功能是处理IO对象,如套接字,从而能异步管理这些对象(而不是多个...
分类:
编程语言 时间:
2014-09-05 19:52:11
阅读次数:
305
1.修改matplotlibrc文件进入Python安装目录下的Lib\site-packages\matplotlib\mpl-data目录,打开matplotlibrc文件,删除font.family和font.sans-serif两行前的#,并在font.sans-serif后添加微软雅黑字体...
flag = 1while 1: flag = flag + 1 if flag > 10: break try: f = open("file-not-exists", "r") except IOError,e: print(...
分类:
编程语言 时间:
2014-09-05 19:46:31
阅读次数:
232
#-*-coding:utf-8-*-#python:2.x__author__='Administrator'importselect,socket,sys,Queue#作用:等待输入或者输出通道已经准备就绪的通知#select模块允许访问特定平台的IO监视函数,可移植接口是POSIX函数sele...
分类:
编程语言 时间:
2014-09-05 19:39:41
阅读次数:
323
最近稍微折腾了下pythonmysqldb发现python无法连接mysql的localhost而php和命令行都没有问题;问了下群里的朋友他们让我使用127.0.0.1作为host我测试了下果真成功了但是我仍然无法理解为啥php和命令行可以而python却无法。而我以前python连接localhost也是成功的.后来我突然想..
分类:
数据库 时间:
2014-09-05 18:30:02
阅读次数:
163