import os
import sys


def convert(path):
    if os.path.isdir(path):
        for p in os.listdir(path):
            convert(path + os.sep + p)
    elif os.path.isfile(path):
        if path.endswith("_h2j.jpg"):
            os.remove(path)


if __name__ == '__main__':
    root_dir = sys.argv[1]
    print("clean heif to jpg start... root dir:" + root_dir)
    convert(root_dir)

import os
import sys


def convert(path):
    if os.path.isdir(path):
        for p in os.listdir(path):
            convert(path + os.sep + p)
    elif os.path.isfile(path):
        if path.endswith("_h2j.jpg"):
            os.remove(path)


if __name__ == '__main__':
    root_dir = sys.argv[1]
    print("clean heif to jpg start... root dir:" + root_dir)
    convert(root_dir)
