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 ...
随机推荐
- js 创建书签小工具之理论
我们一直在寻找增加浏览体验的方法,有的方法众所周知,有的则鲜为人知.我原本认为书签小工具属于后者,非常令人讨厌的东西.令我非常懊恼的是我发现在这个问题上我完全是错误的.它并不是令人厌烦的,而是以用户为 ...
- LR中Vugen的多进程与多线程(脚本命令行)
Controller使用驱动程序(如mdrv.exe或r3vuser.exe)来运行Vuser.用户可以在Controller的run-time setting中选择Vuser的运行方式:多进程/多线 ...
- Paging
COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION Both unequal fixed-si ...
- freemarker 自定义标签
1.编写标签类 package com.pccw.business.fnd.common.filegen; import java.io.IOException; import java.io.Wri ...
- JS中数组对象去重
JS数组去重 JS中对数组去重最好不要用unique方法,该方法主要是对dom节点数组的去重,如果对普通的数组元素去重只会去掉与之相邻的重复元素,也就是如果数组中还有不相邻的重复元素存在,将不会被去掉 ...
- Visual Studio 2005安装qt-win-commercial-src-4.3.1,并设置环境变量
虽然已经在Visual Studio 2005下安装Qt4已经n次了,还是打算在上写写安装方法. qt-win-commercial-src-4.3.1.zip.qt-vs-integration-1 ...
- Windows下一个比较完美的线程池实现(使用线程池实现的Http上传下载实现)
http://blog.csdn.net/fishjam/article/details/8632049 http://download.csdn.net/user/fishjam
- 用httpPost对JSON发送和接收
HTTPPost发送JSON: private static final String APPLICATION_JSON = "application/json"; private ...
- Oracle横向纵向汇总
Oracle横向纵向汇总 有一张表test 如下, (NO 学生编号 ,cj 成绩) NO name KM CJ 001 张三 语文 80 001 张三 数学 86 001 张三 英语 75 0 ...
- groovy
1.加载和卸载(每次都新建一个GroovyClassLoader 实例,然后使用新建的classloader去加载) try { GroovyClassLoader groovyClassLoader ...