Преглед на файлове

Check if file already exists

Jérôme BUISINE преди 3 години
родител
ревизия
0d9ef1d629
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      run/convert_all_rawls.py

+ 4 - 1
run/convert_all_rawls.py

@@ -26,7 +26,10 @@ def main():
         if not os.path.exists(output_folder):
             os.makedirs(output_folder)
         
-        os.system(f'./build/main/rawls_convert --image {img} --outfile {output_path}')
+        if not os.path.exists(output_path):
+            os.system(f'./build/main/rawls_convert --image {img} --outfile {output_path}')
+        else:
+            print(f'{output_path} already exists')
     
 
 if __name__ == "__main__":