Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -66,7 +66,7 @@ if img_file_buffer is not None:
|
|
66 |
raw_data = {'date': [time.asctime(time.localtime(time.time()))], 'v_number': [text]}
|
67 |
df = pd.DataFrame(raw_data, columns=['date', 'v_number'])
|
68 |
|
69 |
-
|
70 |
file_path = os.path.join("data", "data.csv")
|
71 |
if os.path.exists(file_path):
|
72 |
# Append the data to the existing CSV file
|
@@ -78,7 +78,10 @@ if img_file_buffer is not None:
|
|
78 |
else:
|
79 |
# Create a new CSV file and write the data
|
80 |
df.to_csv(file_path, index=False)
|
81 |
-
|
|
|
|
|
|
|
82 |
|
83 |
# Print recognized text
|
84 |
st.write("Recognized Text:",text)
|
|
|
66 |
raw_data = {'date': [time.asctime(time.localtime(time.time()))], 'v_number': [text]}
|
67 |
df = pd.DataFrame(raw_data, columns=['date', 'v_number'])
|
68 |
|
69 |
+
# Check if the CSV file exists
|
70 |
file_path = os.path.join("data", "data.csv")
|
71 |
if os.path.exists(file_path):
|
72 |
# Append the data to the existing CSV file
|
|
|
78 |
else:
|
79 |
# Create a new CSV file and write the data
|
80 |
df.to_csv(file_path, index=False)
|
81 |
+
|
82 |
+
# Print some debug information
|
83 |
+
st.write("CSV File Path:", file_path)
|
84 |
+
st.write("CSV File Exists:", os.path.exists(file_path))
|
85 |
|
86 |
# Print recognized text
|
87 |
st.write("Recognized Text:",text)
|