python
huguangshanse00
这个作者很懒,什么都没留下…
展开
-
python 将一个文件中内容添加到另一个文件指定位置
目的:将文件test.txt内容添加到文件test.html指定字符串的前面文件内容: test.txt内容如下: 10.110.210.310.410.510.610.710.810.910.1010.1110.1210.1310.1410.1510.1610.1710.1810.1910.2010.2110.22 text.html内容如原创 2013-11-09 00:16:12 · 21898 阅读 · 0 评论 -
查找文件夹下包含指定字符串的文件名字
1. shell 命令grep -n "stringname" -r ./原创 2014-11-21 23:29:29 · 2934 阅读 · 0 评论 -
python 并发执行
参考:(1)原创 2014-08-03 11:42:17 · 4881 阅读 · 0 评论 -
python 进程
[wln@localhost python]$ cat 01.py#!/usr/bin/env pythonimport os ,sys"""A basic fork in action"""import osprint '01'*5child = os.fork()if child == 0: cmd = 'sudo top -b > a.top'原创 2013-11-30 00:54:05 · 837 阅读 · 0 评论 -
python 读取文本文件内容转化为python的list
1.目的读取cal.txt内容,然后通过python脚本转化为list内容2. 文件内容 cal.txt1213141516cal.py脚本内容:#!/usr/bin/python#coding = UFT-8result=[]fd = file( "cal.txt", "r" )for line in fd.readlines():原创 2013-11-09 01:28:31 · 59583 阅读 · 5 评论 -
linux date 时间格式处理
[wln@localhost python]$ date "+%H:%M:%S"05:13:27[wln@localhost python]$ date -d today +"%Y-%m-%d %H:%M:%S"2013-10-07 05:14:18原创 2013-11-09 00:21:32 · 957 阅读 · 0 评论 -
python producer and consumer
python 生产者消费者原创 2017-03-27 00:32:58 · 519 阅读 · 0 评论