从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的更多相关文章

  1. 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 ...

  2. 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 ...

  3. File Operation using SHFileOperation

    SHFILEOPSTRUCT Original link: http://winapi.freetechsecrets.com/win32/WIN32SHFILEOPSTRUCT.htm Refere ...

  4. Python:文件操作技巧(File operation)(转)

    Python:文件操作技巧(File operation) 读写文件 # ! /usr/bin/python #  -*- coding: utf8 -*- spath = " D:/dow ...

  5. 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 ...

  6. Python & file operation mode

    Python & file operation mode create/read/write/append mode https://docs.python.org/3/library/fun ...

  7. Mac OS X系统下,svn: Can't remove file Operation not permitted.解决方案

    当你的svn出现类似以下错误时,提示Operation not permitted之类的问题,说明项目下 .svn文件夹内的文件权限有问题. 一般是由于windows和mac操作系统同时操作同个svn ...

  8. PythonStudy——文件操作 File operation

    # 文件:就是硬盘的一块存储空间 # 1.使用文件的三步骤: # 打开文件- 得到文件对象:找到数据存放在硬盘的位置,让操作系统持有该空间,具有操作权# 硬盘空间 被 操作系统持有# 文件对象f 被 ...

  9. python file operation

    file.open(name[,mode[,buffering]]) 模式的类型有: r 默认只读 w     以写方式打开,如果文件不存在则会先创建,如果文件存在则先把文件内容清空(truncate ...

随机推荐

  1. fleetctl --help

    NAME:    fleetctl - fleetctl is a command-line interface to fleet, the cluster-wide CoreOS init syst ...

  2. 怎么样打印加密PDF文件

    自然是解密后再打印.解密的方法,在linux下执行: pdf2ps xxx.pdf ps2pdf xxx.ps 参考资料 http://www.cyberciti.biz/faq/removing-p ...

  3. CSS Questions:Front-end Developer Interview Questions

    Describe what a "reset" CSS file does and how it's useful. What Is A CSS Reset? A CSS Rese ...

  4. ActionResult,PartialViewResult,EmptyResult,ContentResult

    HttpGet  HttpPost  HttpDelete  HttpPut  HeepHead HttpOptions HttpPatch属性都是动作方法选定器的一份子,比如若在action上套用H ...

  5. 发布(高程数据)服务,Service Editor界面无LERC格式选项

    [问题描述]: ArcGIS Server 发布(高程数据)服务,无 LERC格式选项,而官方帮助中发布流程提示需要选择LERC格式. [解决办法]: 需求:发布高程数据,ArcGIS Server版 ...

  6. epoll 实际使用

    void DataHandle::recv() {     sleep(2);     _data_router -> readInfoHw(&mInfo);     ALOGD(SYS ...

  7. PHP基础语法: echo,var_dump, 常用函数:随机数:拆分字符串:explode()、rand()、日期时间:time()、字符串转化为时间戳:strtotime()可变参数的函数:PHP里数组长度表示方法:count($attr[指数组]);字符串长度:strlen($a)

    PHP语言原理:先把代码显示在源代码中,再通过浏览器解析在网页上 a. 1.substr;  //用于输出字符串中,需要的某一部分 <?PHP $a="learn php"; ...

  8. IE 的resize事件问题

    window的resize事件,真的让人无语! 我在动态设置元素的HTML内容后,窗口高度变化了,可是却不触发resize事件. 但是我在访问document.documentElement.scro ...

  9. RocEDU.阅读.写作

    RocEDU.阅读.写作 一.选择图书 <黑客大曝光> 二.读书计划 56天内学习完.时间:2016.01.25--2016.03.20 三.承诺 宋宸宁郑重承诺: 1.在56天内(开始时 ...

  10. VS下如何调试多线程

    四步即可 1.打开多线程窗口,找到当前线程 此时,出现窗口如下: 2.右击任意位置,选中全部线程 3.停止全部线程 此时,线程状态如下: 4.单独启动当前线程:先单击当前线程,在点击启动按钮,如下红色 ...