
Python
文章平均质量分 78
lxneng
这个作者很懒,什么都没留下…
展开
-
使用Pyments高亮显示代码为html
Pygments —— Python syntax highlighter (http://pygments.org/)[code="首先要安装Pygments"]easy_install pygments[/code]实例代码:[code="Python"]#!/usr/bin/env python# encoding: utf-8"""code2html.py...2009-09-14 22:47:47 · 319 阅读 · 0 评论 -
利用orange进行关联规则挖掘
转自:http://www.fuchaoqun.com/2008/08/data-mining-with-python-orange-association_rule/ 最近,趁着项目的间隙,折腾了一阵数据挖掘,在同事的帮助下,对新浪音乐用户的听歌记录进行了一个简易挖掘,希望能根据用户以往的听歌记录,推荐出用户可能感兴趣的其他歌曲。Orange:一个模块化的C++数据挖掘包,提...原创 2009-09-18 10:43:57 · 734 阅读 · 0 评论 -
正则匹配手机号码
[code="Python"]In [1]: import reIn [2]: test_str = 'fhdjhfdhf13888888888fdfsdfs15888888888hfdjfhjsdhfds'In [3]: p = re.compile(r'((13[0-9]|15[0-9]|18[89])\d{8})')In [4]: p.search(test_st...2009-09-26 15:29:06 · 201 阅读 · 0 评论 -
非常简单的Python HTTP服务
转自http://coolshell.cn/?p=1480如果你急需一个简单的Web Server,但你又不想去下载并安装那些复杂的HTTP服务程序,比如:Apache,ISS等。那么, Python 可能帮助你。使用Python可以完成一个简单的内建 HTTP 服务器。于是,你可以把你的目录和文件都以HTTP的方式展示出来。佻只需要干一件事情,那就是安装一个Python。实际上来...原创 2009-10-16 10:56:05 · 438 阅读 · 0 评论 -
安装试用基于HTTP协议的开源中文分词系统“HTTPCWS”
[url=http://code.google.com/p/httpcws/]官方程序地址[/url]安装在ubuntu9.10上:[code="shell"]cd /usr/localsudo wget http://httpcws.googlecode.com/files/httpcws-1.0.0-i386-bin.tar.gzsudo sutar zxvf ht...2009-12-09 10:30:29 · 175 阅读 · 0 评论 -
获得下载文件的大小(Python)
[code="Python Shell"]>>> import urlparse>>> import httplib>>> parsedurl = urlparse.urlparse('http://vfile.home.news.cn/music/public/vd06/200907/23/4a/MUfs0620090723163313524a2f29.mp3')>>> http...2009-08-18 22:14:09 · 437 阅读 · 0 评论 -
What do Python 2.x programmers need to know about Python 3?
With the latest major Python release, creator Guido van Rossum saw theopportunity to tidy up his famous scripting language. What is differentabout Python 3.0? In this article, I offer some h...原创 2009-08-19 09:08:23 · 102 阅读 · 0 评论 -
使用python_select进行Python多版本切换
python_select: Switch the default python interpreter比如安装了2.5, 2.6, 3.1版本,要把2.6设置为默认版本,可以用python_select进行切换[code="shell"]sudo port install python_select sudo python_select python26[/code]ps:...2009-08-26 10:00:31 · 99 阅读 · 0 评论