srikrishna1 commited on
Commit
c6f0da8
·
verified ·
1 Parent(s): fa98ead

Update sample_script.py

Browse files
Files changed (1) hide show
  1. sample_script.py +5 -7
sample_script.py CHANGED
@@ -1,8 +1,6 @@
1
- # /home/user/Desktop/script.py
 
 
 
2
 
3
- output_path = "/home/user/Desktop/output.txt"
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")