diff --git a/convert_img_to_dna.py b/Image2DNA.py similarity index 93% rename from convert_img_to_dna.py rename to Image2DNA.py index a7d218c..b41511e 100644 --- a/convert_img_to_dna.py +++ b/Image2DNA.py @@ -149,10 +149,14 @@ def process_directory(dir_path): convert_dna_list_to_jpeg(file_path) print("Processing the DNA sequence file wihtin {}...Done".format(file_path)) -# 判断路径是文件还是目录,并调用相应的处理函数 -if os.path.isfile(args.path): - convert_jpeg_to_dna_list(args.path) -elif os.path.isdir(args.path): - process_directory(args.path) -else: - print(f'{args.path} is not a file or directory') \ No newline at end of file +def main(): + # 判断路径是文件还是目录,并调用相应的处理函数 + if os.path.isfile(args.path): + convert_jpeg_to_dna_list(args.path) + elif os.path.isdir(args.path): + process_directory(args.path) + else: + print(f'{args.path} is not a file or directory') + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/images_sample/input.jpg b/images_sample/input.jpg new file mode 100644 index 0000000..bc5a0ee Binary files /dev/null and b/images_sample/input.jpg differ