awacke1 commited on
Commit
0f25660
·
1 Parent(s): e816e74

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -38,8 +38,6 @@ def display_images_from_csv():
38
  st.image(img_path, width=100, caption=row[0])
39
 
40
  # cut--
41
- import streamlit as st
42
- import csv
43
 
44
  def remove_duplicates_csv(file_path):
45
  with open(file_path, mode='r') as f:
@@ -52,6 +50,12 @@ def remove_duplicates_csv(file_path):
52
  writer.writerow(row)
53
 
54
  csv_file_path = "Resources.csv"
 
 
 
 
 
 
55
  remove_duplicates_csv(csv_file_path)
56
 
57
  with open(csv_file_path, mode='r') as f:
 
38
  st.image(img_path, width=100, caption=row[0])
39
 
40
  # cut--
 
 
41
 
42
  def remove_duplicates_csv(file_path):
43
  with open(file_path, mode='r') as f:
 
50
  writer.writerow(row)
51
 
52
  csv_file_path = "Resources.csv"
53
+
54
+ if not os.path.exists(csv_file_path):
55
+ with open(csv_file_path, mode='w', newline='') as f:
56
+ writer = csv.writer(f)
57
+ writer.writerow(['Name', 'File Name', 'Image Type'])
58
+
59
  remove_duplicates_csv(csv_file_path)
60
 
61
  with open(csv_file_path, mode='r') as f: