Skip to content
Snippets Groups Projects
Commit c20ce2dc authored by Antonio MATTAR's avatar Antonio MATTAR
Browse files

-Added the feature of directly deleting the temp file after using it.

parent d3e70745
No related branches found
No related tags found
No related merge requests found
......@@ -95,8 +95,10 @@ def run_beta_reduction_totale(terme,path='beta_reduction_totale'):
if save_image_choice == 'y':
os.makedirs("./sauvegarde/"+path, exist_ok=True)
moveImages(path,'./sauvegarde/'+path)
os.rmdir(path)
elif save_image_choice == 'n':
delete_images(path)
os.rmdir(path)
def run_beta_reduction_interactive_totale(terme,path='beta_reduction_interactive_totale'):
terme = parsing.parseTerm(terme)
......@@ -110,8 +112,10 @@ def run_beta_reduction_interactive_totale(terme,path='beta_reduction_interactive
if save_image_choice == 'y':
os.makedirs("./sauvegarde/"+path, exist_ok=True)
moveImages(path,'./sauvegarde/'+path)
os.rmdir(path)
elif save_image_choice == 'n':
delete_images(path)
os.rmdir(path)
def run_show_numbers(path):
os.makedirs(path, exist_ok=True)
......@@ -133,8 +137,10 @@ def run_show_numbers(path):
if save_image_choice == 'y':
os.makedirs("./sauvegarde/"+path, exist_ok=True)
moveImages(path,'./sauvegarde/'+path)
os.rmdir(path)
elif save_image_choice == 'n':
delete_images(path)
os.rmdir(path)
elif choice==2:
clear()
......@@ -149,8 +155,10 @@ def run_show_numbers(path):
if save_image_choice == 'y':
os.makedirs("./sauvegarde/"+path, exist_ok=True)
moveImages(path,'./sauvegarde/'+path)
os.rmdir(path)
elif save_image_choice == 'n':
delete_images(path)
os.rmdir(path)
elif choice==3:
run_main_menu()
......@@ -173,8 +181,10 @@ def run_boolean_expression(path):
if save_image_choice == 'y':
os.makedirs("./sauvegarde/"+path, exist_ok=True)
moveImages(path,'./sauvegarde/'+path)
os.rmdir(path)
elif save_image_choice == 'n':
delete_images(path)
os.rmdir(path)
elif choice==2:
clear()
t = app_functions.AND
......@@ -186,8 +196,10 @@ def run_boolean_expression(path):
if save_image_choice == 'y':
os.makedirs("./sauvegarde/"+path, exist_ok=True)
moveImages(path,'./sauvegarde/'+path)
os.rmdir(path)
elif save_image_choice == 'n':
delete_images(path)
os.rmdir(path)
elif choice==3:
clear()
t = app_functions.OR
......@@ -199,8 +211,10 @@ def run_boolean_expression(path):
if save_image_choice == 'y':
os.makedirs("./sauvegarde/"+path, exist_ok=True)
moveImages(path,'./sauvegarde/'+path)
os.rmdir(path)
elif save_image_choice == 'n':
delete_images(path)
os.rmdir(path)
elif choice ==4:
clear()
t = app_functions.XOR
......@@ -212,8 +226,10 @@ def run_boolean_expression(path):
if save_image_choice == 'y':
os.makedirs("./sauvegarde/"+path, exist_ok=True)
moveImages(path,'./sauvegarde/'+path)
os.rmdir(path)
elif save_image_choice == 'n':
delete_images(path)
os.rmdir(path)
elif choice==5:
clear()
......@@ -226,8 +242,10 @@ def run_boolean_expression(path):
if save_image_choice == 'y':
os.makedirs("./sauvegarde/"+path, exist_ok=True)
moveImages(path,'./sauvegarde/'+path)
os.rmdir(path)
elif save_image_choice == 'n':
delete_images(path)
os.rmdir(path)
elif choice==6:
run_main_menu()
......@@ -298,8 +316,10 @@ def run_arithmetic_operations_menu(path='arithmetic expressions'):
if save_image_choice == 'y':
os.makedirs("./sauvegarde/"+path, exist_ok=True)
moveImages(path,'./sauvegarde/'+path)
os.rmdir(path)
elif save_image_choice == 'n':
delete_images(path)
os.rmdir(path)
return_main_menu()
elif choice == 2:
clear()
......@@ -311,8 +331,10 @@ def run_arithmetic_operations_menu(path='arithmetic expressions'):
if save_image_choice == 'y':
os.makedirs("./sauvegarde/"+path, exist_ok=True)
moveImages(path,'./sauvegarde/'+path)
os.rmdir(path)
elif save_image_choice == 'n':
delete_images(path)
os.rmdir(path)
return_main_menu()
elif choice == 3:
clear()
......@@ -324,8 +346,10 @@ def run_arithmetic_operations_menu(path='arithmetic expressions'):
if save_image_choice == 'y':
os.makedirs("./sauvegarde/"+path, exist_ok=True)
moveImages(path,'./sauvegarde/'+path)
os.rmdir(path)
elif save_image_choice == 'n':
delete_images(path)
os.rmdir(path)
return_main_menu()
elif choice==4:
clear()
......@@ -337,8 +361,10 @@ def run_arithmetic_operations_menu(path='arithmetic expressions'):
if save_image_choice == 'y':
os.makedirs("./sauvegarde/"+path, exist_ok=True)
moveImages(path,'./sauvegarde/'+path)
os.rmdir(path)
elif save_image_choice == 'n':
delete_images(path)
os.rmdir(path)
return_main_menu()
elif choice==5:
clear()
......@@ -350,8 +376,10 @@ def run_arithmetic_operations_menu(path='arithmetic expressions'):
if save_image_choice == 'y':
os.makedirs("./sauvegarde/"+path, exist_ok=True)
moveImages(path,'./sauvegarde/'+path)
os.rmdir(path)
elif save_image_choice == 'n':
delete_images(path)
os.rmdir(path)
return_main_menu()
elif choice==6:
clear()
......@@ -363,8 +391,10 @@ def run_arithmetic_operations_menu(path='arithmetic expressions'):
if save_image_choice == 'y':
os.makedirs("./sauvegarde/"+path, exist_ok=True)
moveImages(path,'./sauvegarde/'+path)
os.rmdir(path)
elif save_image_choice == 'n':
delete_images(path)
os.rmdir(path)
return_main_menu()
elif choice == 7:
clear()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment