Update sample_script.py
Browse files- sample_script.py +5 -7
sample_script.py
CHANGED
|
@@ -1,8 +1,6 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
with open(output_path, "w") as f:
|
| 6 |
-
f.write("Hello from sample Python script!")
|
| 7 |
-
|
| 8 |
-
print(f"Output written to {output_path}")
|
|
|
|
| 1 |
+
from docx import Document
|
| 2 |
+
doc = Document()
|
| 3 |
+
doc.add_paragraph("Hello from sample Python script!")
|
| 4 |
+
doc.save("/home/user/Desktop/output.docx")
|
| 5 |
|
| 6 |
+
print("output.docx generated at output.docx")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|