按类别查询搜索结果
关于关键词 的检测结果,共 879
pisces-h2 | 2013-11-02 13:44:56 | 阅读(1480) | 评论(0)
linux环境下$ mkdir pythontest$ cd pythontest$ easy_install pip$ pip install virtualenv$ virtualenv env$ source env/bin/activate .//用于启用虚拟环境,activate后有一个点....$ pip install django下面安装mysql-python,用于python与mysql数据库交互$ pip install mysq...【阅读全文】
qingheliu | 2013-11-01 15:09:08 | 阅读(1410) | 评论(0)
1:下载setuptools软件我下载的版本为setuptools-1.1.7.tar.gz2:解压,tar zxcvf setuptools-1.1.7.tar.gz3:  安装,cd setuptools-1.1.7python setup.py install4:使用easy_install安装[root@hy1 liuxiaojie]# which easy_install/usr/bin/easy_install[root@hy1 liuxiaojie]# easy_instal...【阅读全文】
qingheliu | 2013-11-01 15:00:17 | 阅读(1400) | 评论(0)
1:安装模块时提示解决方法 :yum -y install python-devel2:解决方法:[root@hy1 tools]# yum -y installMySQL-pythonLoaded plugins: fastestmirror, securityLoading mirror speeds from cached hostfile.....但运行时提示连接不上db_mysql_exceptions.OperationalError: (2002,"Can't connect to l...【阅读全文】
twoword | 2013-10-24 12:48:27 | 阅读(1630) | 评论(0)
最新的 CentOS 版本是 6.4 ,其default 的 Python 版本是 2.6.6 。但是一些最新的 Python 应用,比如 goagent 等,需要 2.7 以上版本。同时,Python 还有3.3版本。CentOS 目前还未提供正式的通过 yum 升级到 2.7 的途径。而自己升级会导致 yum 工作不正常。所以,升级到 2.7 需很小心。步骤如下:1,下载 pyth...【阅读全文】
wjfcareer | 2013-10-22 15:22:29 | 阅读(27920) | 评论(0)
 yum 安装一个软件包,出现如下错误; -bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory查看yum和python的rpm是否安装,系统已安装yum和python的的rpm包。查看一下系统命令:# ll /usr/bin/yum    #yum命令存在-rwxr-xr-x 1 root root 801 Sep 21  2011 ...【阅读全文】
jun1484528313 | 2013-10-20 20:17:24 | 阅读(1830) | 评论(0)
冒泡排序:将已经排序区域放于列表的末尾,在遍历列表的过程中,将元素两两比较,并将较大的元素交换到更高的位置上去。如此反复,直到所有元素都排序好位置。以下两个python冒泡排序:#vim   bubble_sort.py  1 #!/usr/bin/env python  2   3 def bubble_sort1(L):    &nbs...【阅读全文】
Larpenteur | 2013-10-17 09:09:00 | 阅读(740) | 评论(0)
近期在调试一个内存泄露的问题。因为涉及到编解码,像Valgrind这样的工具没办法正常运行呀。。。只得苦逼的人工查找。因为程序内存泄露缓慢,需人为的间隔记录内存状态,故想用python写个监测脚本,监测程序内存状态,间隔将数值写入csv文件,方便分析。经查找,可以利用commands模块来实现。做个试验:...【阅读全文】
wujing168 | 2013-10-10 18:15:33 | 阅读(4250) | 评论(0)
转自:http://www.cnblogs.com/taosim/articles/3134405.html【阅读全文】
【LINUX】 python 剖图
zongg | 2013-10-10 14:34:06 | 阅读(2140) | 评论(0)
damofeixue64 | 2013-10-10 11:44:18 | 阅读(1250) | 评论(0)
reload(sys)sys.setdefaultencoding('utf-8')sys.stdout.flush()#encoding=utf-8    print 'Title:     '+entry['title'].encode('utf-8')    print 'Publisher: '+entry['publisher'].encode('utf-8')【阅读全文】
qianzhongjie | 2013-10-07 23:02:53 | 阅读(460) | 评论(0)
#2013_10_05   星期六   add by greshem:P:\_xfile_2010_04\Python-2.4.3.chm::/index.htmlpython 的run 的方式有所不同 或者是 简单的 strings 的run,     或者是 文件 方式的的run 具体的实现 都在这个文件里面定义 root/Python/pythonrun.c最常见的  PyRun_SimpleString...【阅读全文】
jun1484528313 | 2013-10-03 09:41:32 | 阅读(5850) | 评论(0)
    在一个列表中找出重复的值,返回不是重复的值  。这样的例子有很多。    那么如何以集合返回呢?    一开始想到,在定义两个列表A,B ,从给的列表中存值入列表A中,如果有重复的值,就一个入B中。    后来发现python2.7中有个计数功能的 ...【阅读全文】
pisces-h2 | 2013-09-29 17:48:38 | 阅读(10040) | 评论(0)
用python,之前运行的很好,但是UnicodeDecodeError: 'utf8' codec can't decode byte 0xc4 in position 4: invalid continuation byte添加了import sysreload(sys)sys.setdefaultencoding('utf-8')中文decode('utf-8')还是报错,最后发现python运行的机器,编码不是utf8,修改/etc/profile修改编码即可expor...【阅读全文】
jun1484528313 | 2013-09-27 21:44:44 | 阅读(2300) | 评论(0)
        Python 将文本文件的内容读入可以操作的字符串变量非常容易。        文件对象提供了三个“读”方法: .read()、.readline() 和 .readlines()。每种方法可以接受一个变量以限制每次读取的数据量,但它们通常不使用变量。 ...【阅读全文】
wm360459196 | 2013-09-26 10:21:35 | 阅读(130) | 评论(0)
【LINUX】 Python 二三事
coolcole | 2013-09-20 13:30:10 | 阅读(960) | 评论(0)
在这里我假设你已经看完了一篇Python教程,基本熟悉了Python的结构和语法,在命令行下的Python互动环境中尝试过大部分Python的语句,觉得Python是个不错的语言准备继续下去。那么本篇文章会就Python实际运用中相关工具的选择,包括IDE,调试套件,第三方库管理工具这些进行介绍。另外还会对某些中文环境下容易遇到的问...【阅读全文】
impact-crusher | 2013-09-16 11:51:19 | 阅读(440) | 评论(0)
astr = """Feldspar production line Crushing and screening plant for feldspar production line Feldspar crushing plant for saleSBM Machinery offers a fleet of feldspar crushing and screening line with hard rock jaw crusher, cone crusher, large scale impact crusher, hopper, feeder, scr...【阅读全文】
jun1484528313 | 2013-09-07 09:45:42 | 阅读(1380) | 评论(0)
sandy_rock | 2013-08-26 15:32:35 | 阅读(380) | 评论(0)
Simple String operations for Python 2.x (such as split,strip,find,replace,index,count and so on).【阅读全文】
wujing168 | 2013-08-21 23:45:20 | 阅读(820) | 评论(0)
转自:http://www.linuxany.com/archives/1563.html【阅读全文】