Update app.py
Browse files
app.py
CHANGED
|
@@ -16,6 +16,20 @@ if uploaded_file is not None:
|
|
| 16 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".png") as tmp_file:
|
| 17 |
tmp_file.write(uploaded_file.getvalue())
|
| 18 |
tmp_file_path = tmp_file.name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
# Display the uploaded image
|
| 21 |
image = Image.open(tmp_file_path)
|
|
|
|
| 16 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".png") as tmp_file:
|
| 17 |
tmp_file.write(uploaded_file.getvalue())
|
| 18 |
tmp_file_path = tmp_file.name
|
| 19 |
+
|
| 20 |
+
#writing to text file
|
| 21 |
+
#
|
| 22 |
+
#########################
|
| 23 |
+
file = open("uploaded_img.txt", "w")
|
| 24 |
+
|
| 25 |
+
# Write data to the file
|
| 26 |
+
file.write(tmp_file.name)
|
| 27 |
+
file.write("This is a second line.\n")
|
| 28 |
+
|
| 29 |
+
# Close the file
|
| 30 |
+
file.close()
|
| 31 |
+
|
| 32 |
+
|
| 33 |
|
| 34 |
# Display the uploaded image
|
| 35 |
image = Image.open(tmp_file_path)
|