Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1504359
  • 博文数量: 164
  • 博客积分: 2993
  • 博客等级: 少校
  • 技术积分: 1718
  • 用 户 组: 普通用户
  • 注册时间: 2011-06-24 11:42
文章分类

全部博文(164)

文章存档

2014年(1)

2013年(36)

2012年(90)

2011年(37)

发布时间:2013-10-23 11:35:56

1.遍历文件夹import osimport os.pathrootdir = “d:\data” # 指明被遍历的文件夹for parent,dirnames,filenames in os.walk(rootdir): #三个参数:分别返回1.父目录 2.所有文件夹名字(不含路径) 3.所有文件名字 .........【阅读全文】

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

发布时间:2013-10-10 11:38:25

python有很多模块都是用来操作excel的,比如xlrd,xlwt,pyExcelerator。用着很方便,但是问题是,只能支持到excel2003。虽然一般的应用其实足够了,但是如果遇到了导出大量数据(超过65535条)的需求时,excel2003就不够用了。所以我就只好去找一个能支持excel2007的模块。google了一下,发现了这个openpyxl,不过网.........【阅读全文】

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

发布时间:2013-07-31 17:42:50

1、linuxany.c代码如下:#include "stdio.h"void display(char* msg){    printf("%s\n",msg);} int add(int a,int b){    return a+b;}2、编译c代码.........【阅读全文】

阅读(21225) | 评论(1) | 转发(1)

发布时间:2013-07-31 16:32:56

Here's a demo:from ctypes import * foo = (c_char * 4)() #char数组foo.value = "foo" print foo.raw # => 'foo\x00' foo_ptr = cast(foo, c_char_p) print foo_ptr.value # => 'foo'......【阅读全文】

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

发布时间:2013-07-31 16:30:09

This article explains how to write a DLL/SO in C/C++ for PythonNote: Cython can also be used to create and wrap C libraries for Python, and might be a good alternative to the approach explained in this article.Create a new file and write, for example, a function .........【阅读全文】

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

登录 注册