Chinaunix首页 | 论坛 | 博客
  • 博客访问: 306620
  • 博文数量: 214
  • 博客积分: 4258
  • 博客等级: 上校
  • 技术积分: 2021
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-02 09:16
个人简介

http://blog.csdn.net/ly21st http://ly21st.blog.chinaunix.net

文章分类

全部博文(214)

文章存档

2018年(16)

2015年(1)

2014年(2)

2012年(22)

2011年(173)

发布时间:2011-12-18 20:40:53

遇到的问题是,我把E-mail地址收集在txt文件中(每行一个E-mail地址,共78000行),要求是把其中重复的E-mail地址全部去掉。考虑编程方便,我用了CString类,但似乎效率不高。我写出来的整理78000份E-mail地址的需要近7分钟的时间 我给他用Python实现了一个(这个版本是修改过的,当时我随手实现的一个版本做错了,呵.........【阅读全文】

阅读(356) | 评论(0) | 转发(0)

发布时间:2011-12-18 14:29:47

值转换为字符串的两种机制可以通过以下两个函数来使用这两种机制:一是通过str函数,它会把值转换为合理形式的字符串,以便用户可以理解; 而repr会创建一个字符串,它以合法的python表达式的形式来表示值。下面是一些例子:>>> print repr("hello")'hello'>>> print repr(1000L)1000L>>> print str("hello")hel.........【阅读全文】

阅读(331) | 评论(0) | 转发(0)

发布时间:2011-12-17 13:39:37

#include <iostream>#include <map>#include <sstream>#include <cctype>#include <algorithm>using namespace std;#define Py_INCREF(obj) obj->ob_refcnt++#define Py_DECREF(obj) obj->ob_refcnt--; #define Py_XINCREF(obj) {if obj==NULL ; \      else  Py_INCREF(.........【阅读全文】

阅读(424) | 评论(0) | 转发(0)

发布时间:2011-12-07 12:45:36

python的扩展 源文件 #include "Python.h" static char py_gcd_doc[]="Computes the gcd of two integers";static PyObject*py_gcd(PyObject *self,PyObject *args) {       int x,y,r;        if (!PyArg_ParseTuple(args,".........【阅读全文】

阅读(555) | 评论(0) | 转发(0)

发布时间:2011-12-06 14:22:57

from datetime import *import timeprint date.maxprint date.minprint date.today()print date.fromtimestamp(time.time()) 结果:9999-12-310001-01-012011-12-062011-12-06 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.........【阅读全文】

阅读(300) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册