file operation note
从HLE回来,大家拍了2499张照片,分放在N个文件夹下,下面的python将下层目录中文件移动到上层
import os,shutil
dst=os.getcwd()+os.sep
for path in os.listdir('.'):
if os.path.isdir(path):
os.chdir(path)
for file in os.listdir('.'):
print file
ful=os.getcwd()+os.sep+file
os.rename(ful,dst+file)
os.chdir('..')
0607加完一天班,回来传图片到QQ(小装一下^^),每次只能传300张,重命名目录下所有照片的名字为(0.jpe,1.jpg...还是自己起的名字好记)
import os
i=0
os.chdir('tph')
dstpath=os.getcwd()+os.sep
for fname in os.listdir('.'):
os.rename(dstpath+fname,dstpath+str(i)+'.jpg')
i=i+1
拷贝suse 壁纸脚本
#!/bin/sh dircnt=
jcnt=
for dirnm in `ls wallpapers`
do
dircnt=$(ls wallpapers/${dirnm}/contents/images/ | wc -l) if [ $dircnt -gt ];then
for jf in `ls wallpapers/${dirnm}/contents/images/`
do
cp wallpapers/${dirnm}/contents/images/${jf} /home/joh/out/${dirnm}_${jcnt}.jpg
echo $jf
jcnt=`expr $jcnt + `
echo $jcnt
done
fi
done
to be continue
file operation note的更多相关文章
- mysql数据库报错:InnoDB: Operating system error number 13 in a file operation
环境:centos6.5 x86_64 启动mysql发现日志报错(日志路径可以查看/etc/my.cnf的配置) 160722 10:34:08 [Note] Found 42570716 of 4 ...
- InnoDB: Operating system error number 87 in a file operation. 错误87的解决方法
InnoDB: Operating system error number 87 in a file operation. 错误87的解决方法 140628 8:10:48 [Note] Plugi ...
- File Operation using SHFileOperation
SHFILEOPSTRUCT Original link: http://winapi.freetechsecrets.com/win32/WIN32SHFILEOPSTRUCT.htm Refere ...
- Python:文件操作技巧(File operation)(转)
Python:文件操作技巧(File operation) 读写文件 # ! /usr/bin/python # -*- coding: utf8 -*- spath = " D:/dow ...
- Adobe ZXPInstaller 报错 Installation failed because of a file operation error.
1. Drag a ZXP file or click here to select a file. 拖放一个 zxp 文件或点击打开选择一个 zxp 文件来安装: 2. Installation f ...
- Python & file operation mode
Python & file operation mode create/read/write/append mode https://docs.python.org/3/library/fun ...
- Mac OS X系统下,svn: Can't remove file Operation not permitted.解决方案
当你的svn出现类似以下错误时,提示Operation not permitted之类的问题,说明项目下 .svn文件夹内的文件权限有问题. 一般是由于windows和mac操作系统同时操作同个svn ...
- PythonStudy——文件操作 File operation
# 文件:就是硬盘的一块存储空间 # 1.使用文件的三步骤: # 打开文件- 得到文件对象:找到数据存放在硬盘的位置,让操作系统持有该空间,具有操作权# 硬盘空间 被 操作系统持有# 文件对象f 被 ...
- python file operation
file.open(name[,mode[,buffering]]) 模式的类型有: r 默认只读 w 以写方式打开,如果文件不存在则会先创建,如果文件存在则先把文件内容清空(truncate ...
随机推荐
- linux 防火墙设置
防火墙的基本操作命令: 查询防火墙状态:[root@localhost ~]# service iptables status<回车> 停止防火墙:[root@localhost ~]# ...
- Ruby--CSV
1. 解析CSV: (1)读取文件:csv = CSV.read("#{Rails.root}/public/data/statecountycity.csv", :headers ...
- solr4.7中文分词器(ik-analyzer)配置
solr本身对中文分词的处理不是太好,所以中文应用很多时候都需要额外加一个中文分词器对中文进行分词处理,ik-analyzer就是其中一个不错的中文分词器. 一.版本信息 solr版本:4.7.0 需 ...
- lvs nginx HAProxy优缺点
LVS的优点:1、抗负载能力强、工作在第4层仅作分发之用,没有流量的产生,这个特点也决定了它在负载均衡软件里的性能最强的;无流量,同时保证了均衡器IO的性能不会受到大流量的影响;2、工作稳定,自身有完 ...
- mysql安装tcmalloc
TCMalloc(Thread-Caching Malloc)是google-perftools工具中的一个,与标准的glibc库的malloc相比,TCMalloc在内存的分配上效率和速度要高得多, ...
- Gradient
https://en.wikipedia.org/wiki/Gradient
- Java Map遍历方式的选择
[原文] 1. 阐述 对于Java中Map的遍历方式,很多文章都推荐使用entrySet,认为其比keySet的效率高很多.理由是:entrySet方法一次拿到所有key和value的集合:而keyS ...
- 蓝牙BLE ATT剖析(一)
一.概述 The attribute protocol allows a device referred to as the server to expose a set of attributes ...
- Prism&MEF构建开发框架 (一)
Shell框架XECA shell.xaml主要起到是一个容器或壳的作用 <Window x:Class="XECA.Shell" xmlns="http ...
- UML时序图总结
前言 在我的工作中,用的最多的就是时序图了.可能由于工作的原因,我也是最喜欢画时序图了,很清楚,很明了,什么时候发送什么消息,到达什么状态,一下子就展示在你的脑海里,对于消息驱动的程序来说,是再好不过 ...