zoukankan      html  css  js  c++  java
  • 几个代码记录一下

    # -*- 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:studycodepythoncodecatchImggzh-small.png
    
    set sourpath=G:studycodepythoncodecatchImggank-685
    set destpath=G:studycodepythoncodecatchImggank-gzh
    if 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
  • 相关阅读:
    移动端的爬坑路
    判断设备ios或android以及判断是否是微信内置浏览器
    使用vue directive 写好的滑动删除功能
    不用ajax,使用json数据渲染商品的方法
    vue中使用swiper的一些坑
    vue的自定义指令的坑
    better-score获取滑动距离的坑
    linux命令
    关于打印
    数据可视化
  • 原文地址:https://www.cnblogs.com/liangblog/p/9916884.html
Copyright © 2011-2022 走看看