码迷,mamicode.com
首页 > 其他好文 > 详细

几个代码记录一下

时间:2018-11-06 19:34:26      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:os.path   file   jpg   bsp   python   extension   记录   exce   大小   

# -*- coding: utf-8 -*-

import traceback
import re
import os

def main(path = poco-gzh-33528,size = 3500):
    dirs = os.listdir(path)
    list_f = []
    num = 0
    count = 0 
    for f in dirs:
        if count == int(size) * num:
            num = num + 1
            if not os.path.exists(path+_page_+str(num)):
                os.mkdir(path+_page_+str(num))
        os.rename(path+/+f,path+_page_+str(num)+/+f)
        count = count + 1
    print(len(list_f))

def rename(path = poco):
    dirs = os.listdir(path)
    num = 0
    count = 0 
    for f in dirs:
        num = num + 1 
        try:
            os.rename(path+/+f,path+/v+str(num)+.jpg)
        except:
            pass
    print(num)
 
if __name__ == __main__:
    path = input(输入路径:)
    #size = input(输入大小:)
    #main(path,size)
    rename(path)
@echo off

setlocal EnableDelayedExpansion
setlocal ENABLEEXTENSIONS
setlocal

cd %1
for %%c in (./*.jpg) do (
   echo %%~nxc
   del /q/a/f/s %%c
   rem ffmpeg -y -i %sourpath%%%~nxc -i %pngpath% -filter_complex overlay=0:H-h  %destpath%%%~nxc
)
pause
@echo off

setlocal EnableDelayedExpansion
setlocal ENABLEEXTENSIONS
setlocal

set pngpath=G:\studycode\pythoncode\catchImg\gzh-small.png

set sourpath=G:\studycode\pythoncode\catchImg\gank-685set destpath=G:\studycode\pythoncode\catchImg\gank-gzhif not exist %destpath% (
    md %destpath%
)
echo %sourpath%
for %%c in (%sourpath%*.jpg) do (
   rem echo %%~nxc
   rem echo %outfile%
   ffmpeg -y -i %sourpath%%%~nxc -i %pngpath% -filter_complex overlay=0:H-h  %destpath%%%~nxc
)
pause
ffmpeg -threads 2 -y -r 10 -i v%d.jpg -i ../audio.mp3 -absf aac_adtstoasc output.mp4

 

几个代码记录一下

标签:os.path   file   jpg   bsp   python   extension   记录   exce   大小   

原文地址:https://www.cnblogs.com/liangblog/p/9916884.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!