Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -69,14 +69,14 @@ if img_file_buffer is not None:
|
|
| 69 |
# Check if the CSV file exists
|
| 70 |
file_path = os.path.join("data", "data.csv")
|
| 71 |
if os.path.exists(file_path):
|
| 72 |
-
|
| 73 |
with open(file_path, mode='a', newline='') as file:
|
| 74 |
writer = csv.writer(file)
|
| 75 |
if os.stat(file_path).st_size == 0:
|
| 76 |
writer.writerow(df.columns)
|
| 77 |
writer.writerow(df.iloc[0])
|
|
|
|
| 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
|
|
|
|
| 69 |
# Check if the CSV file exists
|
| 70 |
file_path = os.path.join("data", "data.csv")
|
| 71 |
if os.path.exists(file_path):
|
| 72 |
+
print("Writing data to CSV file...")
|
| 73 |
with open(file_path, mode='a', newline='') as file:
|
| 74 |
writer = csv.writer(file)
|
| 75 |
if os.stat(file_path).st_size == 0:
|
| 76 |
writer.writerow(df.columns)
|
| 77 |
writer.writerow(df.iloc[0])
|
| 78 |
+
print("Data written successfully!")
|
| 79 |
else:
|
|
|
|
| 80 |
df.to_csv(file_path, index=False)
|
| 81 |
|
| 82 |
# Print some debug information
|