从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. 本田--CRV

    名称:CR-V 类型:紧凑型SUV 排量:2L/2.4L 变速箱:CVT无级变速 价格:18-25W 品牌:本田 生产:东风本田 历史:1995年第一代 外观特点:没啥特点= =空间算大的

  2. nignx的proxy_cache

    http段配置: #cache configclient_body_buffer_size 512k;proxy_connect_timeout 5;proxy_read_timeout 60;pro ...

  3. vi 整行 多行 复制与粘贴

    vi编辑器中的整行(多行)复制与粘贴就非常必要了. 1.复制 1)单行复制 在命令模式下,将光标移动到将要复制的行处,按“yy”进行复制: 2)多行复制 在命令模式下,将光标移动到将要复制的首行处,按 ...

  4. communicate with other processes, regardless of where they are running

    Advanced Programming in the UNIX Environment Third Edition   In the previous chapter, we looked at p ...

  5. php javascript C 变量环境 块级作用域

    <?php $w = 'w'; $wb = '123'.$w; $w = 'ww'; echo $wb; if(TRUE){ $wd = '123wd'; } echo $wd; if(FALS ...

  6. Apache Kafka源码分析 - autoLeaderRebalanceEnable

    在broker的配置中,auto.leader.rebalance.enable (false) 那么这个leader是如何进行rebalance的? 首先在controller启动的时候会打开一个s ...

  7. 获取真实ip的报告

    今天登录九秒社团 http://www.9miao.com/的时候忘记了用户名和密码,尝试了5次都没登录成功,网站弹出提示15分钟后才能再次登录.我纳闷它是怎么判断用户的登录次数,这时候用户还没有登录 ...

  8. nginx 反向代理 取得真实IP和域名

    nginx反向代理后,在应用中取得的ip都是反向代理服务器的ip,取得的域名也是反向代理配置的url的域名,解决该问题,需要在nginx反向代理配置中添加一些配置信息,目的将客户端的真实ip和域名传递 ...

  9. [daily][network] NAT原理(转)

    写在转发之前: 一直以来,我一直有一个疑惑,SNAT的时候,如果两个内网主机恰巧使用了相同的源端口号该怎么办呢? 我自己猜测的方法是改掉一个端口号,把端口一起映射(当然还有另一个设想,就是把包同时广播 ...

  10. 数据库留言板例题:session和cookie区别

    session和cookie区别: <?php session_start(); //session_start();必须写在所有的php代码前边 ?> <!DOCTYPE html ...