1.open使用open打开文件后一定要记得调用文件对象的close()方法。比如可以用try/finally语句来确保最后能关闭文件。file_object = open('thefile.txt')try: all_the_text = file_object.read( )finally: f...
分类:
编程语言 时间:
2014-07-27 22:58:39
阅读次数:
221
## Sphinx configuration file sample## WARNING! While this sample file mentions all available options,# it contains (very) short helper descriptions on...
分类:
其他好文 时间:
2014-07-27 22:46:29
阅读次数:
476
由于在windows下默认是gb编码,而我的vim默认是utf-8(gedit默认也是utf-8),所以打开会成乱码。修改了一下配置文件,使vi支持gb编码就好了。$vi~/.vimrclet &termencoding=&encodingset fileencodings=utf-8,gbk$:w...
分类:
系统相关 时间:
2014-07-27 22:40:29
阅读次数:
303
1. basic optionssed [options] {command} {input-file}sed -nsed -n 'p' a.out打印a.out文件内容-n: 取消默认打印到屏幕功能sed -fsed [options] -f {sed-commands-in-file} {i.....
分类:
其他好文 时间:
2014-07-27 22:35:39
阅读次数:
375
./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var ...
分类:
其他好文 时间:
2014-07-27 22:22:19
阅读次数:
323
问题一:提示出错:cannot load such file -- mysql/mysql_api (LoadError)此时我们回来看gem install mysql 时提示At the time of building this gem, the necessary DLL files whe...
分类:
数据库 时间:
2014-07-27 22:18:29
阅读次数:
289
va] view plaincopyprint?packagecn.cn;importjava.io.BufferedOutputStream;importjava.io.File;importjava.io.FileInputStream;importjava.io.FileOutputStrea...
分类:
编程语言 时间:
2014-07-27 21:33:35
阅读次数:
316
package?com.mzq.util;
import?java.io.File;
import?java.io.FileInputStream;
import?java.io.FileOutputStream;
import?java.io.FileWriter;
import?java.io.IOException;
import?java.io.PrintWriter...
分类:
其他好文 时间:
2014-07-27 12:12:40
阅读次数:
242
最近发现很多接口配置都硬编码在soucefile中了,于是就看了下python怎么解析配置文件,重构下这一块。这个应该是早就要作的。。。[mysqld]
user=mysql
pid-file=/var/run/mysqld/mysqld.pid
skip-external-locking
old_passwords=1
skip-bdb
skip-innodb
users=aa,bb,cc
[name..
分类:
编程语言 时间:
2014-07-27 12:02:08
阅读次数:
255