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

import os


def rename_jpg_files_recursive(directory, start_value, increment):
    current_value = start_value
    for root, dirs, files in os.walk(directory):
        for file in files:
            if file.endswith(".jpg"):
                old_path = os.path.join(root, file)
                new_name = str(current_value) + ".jpg"
                new_path = os.path.join(root, new_name)
                os.rename(old_path, new_path)
                current_value += increment


# 调用函数，传入顶层目录、起始值和递增值
if __name__ == '__main__':
    rename_jpg_files_recursive('/media/hancheng/Simulation4/1013/here_bizhang2_2023-10-13-14-32-23/LIDAR0/jpg',
                               1666841250000, 100)
