上一页 1 ··· 190 191 192 193 194 195 196 197 198 ··· 324 下一页
摘要: import os os.path.isfile('test.txt') # 如果不存在就返回False os.path.exists(directory) # 如果目录不存在就返回Falseos.makedirs(targetDir) os.path.join(targetDir, fi... 阅读全文
posted @ 2014-03-21 21:25 emanlee 阅读(828) 评论(0) 推荐(0) 编辑
摘要: 生成字符串变量str='python String function' 字符串长度获取:len(str)例:print '%s length=%d' % (str,len(str))连接字符串sStr1 = 'strcat'sStr2 = 'append'sStr1 += sStr2print sS 阅读全文
posted @ 2014-03-21 21:20 emanlee 阅读(40514) 评论(1) 推荐(4) 编辑
摘要: 1.格式化输出整数python print也支持参数格式化,与C言的printf似,strHello = "the length of (%s) is %d" %(Hello World,len(Hello World))print strHello#输出果:the length of (Hello... 阅读全文
posted @ 2014-03-21 18:57 emanlee 阅读(830) 评论(0) 推荐(0) 编辑
摘要: 环境:Windows XP + Word 2003 + EndNote 6 以下各方法可以依次试一下,需要重启Word后才能看到是否可行。1 视图 -- 工具栏 -- EndNote,是否打勾。2 word 里 endnote 无法加载,把 C:\Program Files\EndNote X6\Product-Support\CWYW 里的 endnote cwyw.dot 和 endnote cwyw.dotm 这两个文件拷到 C:\Program Files\Microsoft Office\OFFICE11\STARTUP(不同的电脑路径不同)文件夹下。需要重启Word后才能看到是否可 阅读全文
posted @ 2014-03-08 22:53 emanlee 阅读(30160) 评论(1) 推荐(0) 编辑
摘要: # 总核数 = 物理CPU个数 X 每颗物理CPU的核数 # 总逻辑CPU数 = 物理CPU个数 X 每颗物理CPU的核数 X 超线程数 # 查看物理CPU个数 cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l # 查看每个物理CPU中 阅读全文
posted @ 2014-03-08 10:05 emanlee 阅读(823280) 评论(16) 推荐(51) 编辑
摘要: 1、rpm包安装的,可以用 rpm -qa 看到,如果要查找某软件包是否安装,用 rpm -qa | grep "软件或者包的名字"2、以deb包安装的,可以用 dpkg -l 看到。如果是查找指定软件包,用 dpkg -l | grep "软件或者包的名字"3、yum方法安装的,可以用 yum l... 阅读全文
posted @ 2014-03-07 21:55 emanlee 阅读(19639) 评论(0) 推荐(1) 编辑
摘要: # 按列合并文件paste file1 file2 file3 > file4# 要先 sort, 再 joinjoin -a 1 file1 file2paste格式为:paste -d -s -file1 file2选项含义如下:-d 指定不同于空格或tab键的域分隔符。例如用@分隔域,使用 -... 阅读全文
posted @ 2014-03-06 11:23 emanlee 阅读(6514) 评论(0) 推荐(0) 编辑
摘要: #shell判断文件夹是否存在#如果文件夹不存在,创建文件夹if [ ! -d "/myfolder" ]; then mkdir /myfolderfi#shell判断文件,目录是否存在或者具有权限folder="/var/www/"file="/var/www/log"# -x 参数判断 $f... 阅读全文
posted @ 2014-03-06 08:48 emanlee 阅读(393776) 评论(3) 推荐(8) 编辑
摘要: 1 数值类型 MySQL 的数值数据类型可以大致划分为两个类别,一个是整数,另一个是浮点数或小数。许多不同的子类型对这些类别中的每一个都是可用的,每个子类型支持不同大小的数据,并且 MySQL 允许我们指定数值字段中的值是否有正负之分或者用零填补。 下表列出了各种数值类型以及它们的允许范围和占用... 阅读全文
posted @ 2014-02-18 12:53 emanlee 阅读(7989) 评论(1) 推荐(2) 编辑
摘要: Linux/Centos下释放内存和缓存方法$ free -m 运行sync将dirty的内容写回硬盘$ sync通过修改proc系统的drop_caches清理free的cache$ echo 3 > /proc/sys/vm/drop_caches$ free -m 阅读全文
posted @ 2014-02-17 10:54 emanlee 阅读(740) 评论(0) 推荐(0) 编辑
上一页 1 ··· 190 191 192 193 194 195 196 197 198 ··· 324 下一页