Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ import zipfile
|
|
5 |
import os
|
6 |
import subprocess
|
7 |
from datetime import datetime
|
|
|
8 |
|
9 |
# Flag to track if subprocess commands have been executed
|
10 |
subprocess_executed = False
|
@@ -128,5 +129,7 @@ if uploaded_zip_file is not None:
|
|
128 |
|
129 |
except Exception as e:
|
130 |
st.error(f"Error: {str(e)}")
|
|
|
|
|
131 |
|
132 |
st.write("Upload a ZIP file containing DICOM slices to view the images.")
|
|
|
5 |
import os
|
6 |
import subprocess
|
7 |
from datetime import datetime
|
8 |
+
import shutil
|
9 |
|
10 |
# Flag to track if subprocess commands have been executed
|
11 |
subprocess_executed = False
|
|
|
129 |
|
130 |
except Exception as e:
|
131 |
st.error(f"Error: {str(e)}")
|
132 |
+
finally:
|
133 |
+
shutil.rmtree(temp_dir)
|
134 |
|
135 |
st.write("Upload a ZIP file containing DICOM slices to view the images.")
|