yyyyyyyyyyyyyyyyyyyy

博客园 首页 新随笔 联系 订阅 管理

随笔分类 -  python

上一页 1 ··· 7 8 9 10 11 12 下一页

摘要:No module named cv2 阅读全文
posted @ 2015-08-06 01:09 xxxxxxxx1x2xxxxxxx 阅读(149) 评论(0) 推荐(0)

摘要:安装cv2http://hyry.dip.jp/files/opencv.zip采用cv2重写的《Python科学计算》中的实例程序读者可以在下面的页面中搜索“opencv”,并根据Python版本下载对应的安装程序。http://www.lfd.uci.edu/~gohlke/pythonlibs... 阅读全文
posted @ 2015-08-06 01:01 xxxxxxxx1x2xxxxxxx 阅读(1072) 评论(0) 推荐(0)

摘要:OpenCV之Python学习笔记 直都在用Python+OpenCV做一些算法的原型。本来想留下发布一些文章的,可是整理一下就有点无奈了,都是写零散不成系统的小片段。现在看 到一本国外的新书《OpenCV Computer Vision with Python》,于是就看一遍,顺便把自己掌握的东西 阅读全文
posted @ 2015-08-06 00:59 xxxxxxxx1x2xxxxxxx 阅读(768) 评论(0) 推荐(0)

摘要:$cd numpy $ sudo python setup.py build $ sudo python setup.py installRunning from numpy source directory.Cythonizing sourcesnumpy/random/mtrand/mtrand 阅读全文
posted @ 2015-08-06 00:48 xxxxxxxx1x2xxxxxxx 阅读(243) 评论(0) 推荐(0)

摘要:python及相关工具安装Error集 1. 如果升级python版本中出现error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or direc 阅读全文
posted @ 2015-08-06 00:40 xxxxxxxx1x2xxxxxxx 阅读(489) 评论(0) 推荐(0)

摘要:1.安装http://cython.org/release/Cython-0.22.1.tar.gzpython setup.py install2.写测试代码:zhouhh@zhouhh-home:~$ vi test.pyx[python] view plaincopy def sayhe... 阅读全文
posted @ 2015-08-06 00:27 xxxxxxxx1x2xxxxxxx 阅读(534) 评论(0) 推荐(0)

摘要:1. 首先确认python的版本为2.3.4以上,如果不是需要升级python的版本 python -V 检查python版本2. 安装mysql, 比如安装在/usr/local/mysql目录下3. 下载 MySQL-python-1.2.2.tar.gz 地址 http://sourcefor... 阅读全文
posted @ 2015-08-05 02:51 xxxxxxxx1x2xxxxxxx 阅读(264) 评论(0) 推荐(0)

摘要:先看下else的使用:try: ...exception: ...else: ...只有在try中没有发生任何异常,所有代码完全成功的情况下才会转入else再看下finally:finally是无论是否捕捉到异常都会执行的一句,finally 可以单独和try搭配,也可以和exce... 阅读全文
posted @ 2015-08-05 02:38 xxxxxxxx1x2xxxxxxx 阅读(1564) 评论(0) 推荐(0)

摘要:这两个基本上都是在循环的时候用。for i in range(0, 100):print i for i in xrange(0, 100):print i这两个输出的结果都是一样的,实际上有很多不同,range会直接生成一个list对象:a = range(0,100)print type(a)p... 阅读全文
posted @ 2015-08-05 01:03 xxxxxxxx1x2xxxxxxx 阅读(245) 评论(0) 推荐(0)

摘要:$ python thread.py starting at: 2015-08-05 00:24:24Traceback (most recent call last): File "thread.py", line 28, in main() File "thread.py", line 16,... 阅读全文
posted @ 2015-08-05 00:26 xxxxxxxx1x2xxxxxxx 阅读(645) 评论(0) 推荐(0)

摘要:开发部需要使用python2.7,由于公网的环境python版本都是系统自带的,版本是2.6,需要升级,最好是通过RPM升级。Linux系统:CentOSCentOS 6.4升级Python后yum不可用的解决方案 http://www.linuxidc.com/Linux/2013-05/8472... 阅读全文
posted @ 2015-08-05 00:15 xxxxxxxx1x2xxxxxxx 阅读(183) 评论(0) 推荐(0)

摘要:BeautifulSoup 安装使用下载:http://www.crummy.com/software/BeautifulSoup/bs4/download/4.2/解压:tar -xzvfbeautifulsoup4-4.2.0.tar.gz安装:进入解压后的目录python setup.py b... 阅读全文
posted @ 2015-08-04 21:48 xxxxxxxx1x2xxxxxxx 阅读(173) 评论(0) 推荐(0)

摘要:五,python操作mysql数据库基础#coding=utf-8import MySQLdbconn= MySQLdb.connect( host='localhost', port = 3306, user='root', passwd='... 阅读全文
posted @ 2015-07-30 03:24 xxxxxxxx1x2xxxxxxx 阅读(338) 评论(0) 推荐(0)

摘要:python的正则表达式 re本模块提供了和Perl里的正则表达式类似的功能,不关是正则表达式本身还是被搜索的字符串,都可以是Unicode字符,这点不用担心,python会处理地和Ascii字符一样漂亮。正则表达式使用反斜杆(\)来转义特殊字符,使其可以匹配字符本身,而不是指定其他特殊的含义。这可... 阅读全文
posted @ 2015-07-30 03:08 xxxxxxxx1x2xxxxxxx 阅读(622) 评论(0) 推荐(0)

摘要:Python中type与Object的区别在查看了Python的API后,总算明白了。现在总结如下:先来看object的说明: Python中关于object的说明很少,甚至只有一句话:classobjectThemostbasetype 从介绍上看这也是Python对类型统一做出的努力。所以这里的... 阅读全文
posted @ 2015-07-30 02:43 xxxxxxxx1x2xxxxxxx 阅读(275) 评论(0) 推荐(0)

摘要:Python type类视角中的对象体系需要我们不断的学习,其中我们使用的时候需要注意。下面我们就看看如何才能更好的运用Python type类。下面的文章希望大家有所收获。在单纯的Python type类的世界中,一切都是对象.这些对象可以分为三类,metaclasses,classes,inst... 阅读全文
posted @ 2015-07-30 02:41 xxxxxxxx1x2xxxxxxx 阅读(240) 评论(0) 推荐(0)

摘要:如何去除List中的重复值?感谢 http://bbs.csdn.net/topics/390247210。供自己参考:1、通过循环进行删除public static void removeDuplicate(List list) { for ( int i = 0 ;... 阅读全文
posted @ 2015-07-30 02:39 xxxxxxxx1x2xxxxxxx 阅读(231) 评论(0) 推荐(0)

摘要:type,isinstance判断一个变量的数据类型 import types type(x) is types.IntType # 判断是否int 类型 type(x) is types.StringType #是否string类型 .........---------------------... 阅读全文
posted @ 2015-07-30 02:38 xxxxxxxx1x2xxxxxxx 阅读(219) 评论(0) 推荐(0)

摘要:这篇blog主要是总结我们在平常开发过程中对字符串的一些操作:#字母大小写转换#首字母转大写#去除字符串中特殊字符(如:'_','.',',',';'),然后再把去除后的字符串连接起来#去除'hello_for_our_world'中的'_',并且把从第一个'_'以后的单词首字母大写具体的代码dem... 阅读全文
posted @ 2015-07-30 02:37 xxxxxxxx1x2xxxxxxx 阅读(346) 评论(0) 推荐(0)

摘要:python_2.x_unicode_to_str.py a = u"中文字符"; a.encode("GBK"); #打印: '\xd6\xd0\xce\xc4\xd7\xd6\xb7\xfb' print(a.encode("GBK")); 打印: �����ַ� a.encode("utf-8 阅读全文
posted @ 2015-07-30 02:36 xxxxxxxx1x2xxxxxxx 阅读(329) 评论(0) 推荐(0)

上一页 1 ··· 7 8 9 10 11 12 下一页