上一页 1 ··· 29 30 31 32 33
摘要: 1. fopen 打开普通文件带缓冲区撒点粉撒点粉阿桑地方缓冲文件系统是借助文件结构体指针来对文件进行管理,通过文件指针来对文件进行访问,既可以读写字符、字符串、格式化数据,也可以读写二进制数据函数原型:FILE * fopen(const char * path,const char * mode... 阅读全文
posted @ 2015-02-09 20:40 Dus 阅读(7087) 评论(0) 推荐(0) 编辑
摘要: group()函数和groups()函数的区别。一般,m.group(N)第N组括号匹返回配的字符。而m.group() == m.group(0) == 所有匹配的字符,与括号无关,这个是API规定的。m.groups() 返回所有括号匹配的字符,以tuple格式。m.groups() == (m... 阅读全文
posted @ 2015-02-09 18:11 Dus 阅读(162) 评论(0) 推荐(0) 编辑
摘要: MRO(Method resolution order)是python用来解析方法调用顺序的,mro中记录了一个类的所有基类的类类型序列,super不是简单地调用基类的方法,而是按照MRO中的顺序来调用类的方法。使用super()时,应该在所有类中使用,否则就可能发生有的类构造函数没有调用的情况。 ... 阅读全文
posted @ 2015-02-08 13:49 Dus 阅读(1613) 评论(0) 推荐(0) 编辑
摘要: importoswhileTrue:filename=input('Pleaseenterthefilename')ifos.path.exists(filename):print('thefileisexist')breakelse:all=[]whileTrue:content=input('>... 阅读全文
posted @ 2015-02-04 18:50 Dus 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 1、进入root家目录 建立.tab文件.tab文件内容如下:##############################################import sysimport readlineimport rlcompleterimport atexitimport osreadline... 阅读全文
posted @ 2015-02-04 17:28 Dus 阅读(364) 评论(0) 推荐(0) 编辑
摘要: 1、如何用Python删除一个文件os.remove(filename)或者os.unlink(filename)。2、Python如何copy一个文件shutil模块里有一个copyfile函数可以实现文件的拷贝。 阅读全文
posted @ 2015-02-04 14:25 Dus 阅读(522) 评论(0) 推荐(0) 编辑
摘要: import osif os.geteuid() != 0:print "This program must be run as root. Aborting."sys.exit(1) 阅读全文
posted @ 2015-02-04 14:04 Dus 阅读(1581) 评论(0) 推荐(0) 编辑
摘要: 1、Python输出中文怎么解决方法一:用encode和decode如:import os.pathimport xlrd,sysFilename=’/home/tom/Desktop/1234.xls’if not os.path.isfile(Filename):raise NameError,... 阅读全文
posted @ 2015-02-04 14:01 Dus 阅读(397) 评论(0) 推荐(0) 编辑
摘要: <div id="pic_list" <style pic_list li{margin:5px 10px 5px 10px;display:inline block;} pic_list li a{text decoration:none;} pic_list li a:hover{text d... 阅读全文
posted @ 2014-10-21 14:28 Dus 阅读(752) 评论(0) 推荐(0) 编辑
上一页 1 ··· 29 30 31 32 33