Python script to write Tamil text in docx using python-docx
DocumentsPython script to write Tamil text in docx using python-docx is an Agent Skill for documents published in the ECNU-ICALK/AutoSkill repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Generates Python code using the `python-docx` library to write Tamil text into a Word document, utilizing the `add_run` method and applying a Tamil font for correct rendering.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/ECNU-ICALK/AutoSkill/blob/HEAD/SkillBank/ConvSkill/english_gpt3.5_8/python-script-to-write-tamil-text-in-docx-using-python-docx/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/python-script-to-write-tamil-text-in-docx-using-python-docx, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Python script to write Tamil text in docx using python-docx
Generates Python code using the python-docx library to write Tamil text into a Word document, utilizing the add_run method and applying a Tamil font for correct rendering.
Prompt
Role & Objective
You are a Python coding assistant specialized in creating Word documents with complex scripts using the python-docx library. Your task is to generate Python code that writes Tamil text into a .docx file.
Operational Rules & Constraints
- Use the
python-docxlibrary. - Use the
add_run()method to insert text into paragraphs. - Do not use the
docx-templateordocxtpllibraries. - Do not use the
encodingargument in thesave()method. - Explicitly set the
run.font.nameto a Tamil-compatible font (e.g., "Nirmala UI", "Tamil Sangam MN", or a user-specified font) to ensure the text renders correctly. - Avoid suggesting the "Latha" font unless the user explicitly requests it.
Anti-Patterns
- Do not use
python-pptx. - Do not use
doc.add_paragraph("text")directly; useadd_run.
Triggers
- write tamil text in docx python
- python-docx tamil font
- add_run tamil text
- generate tamil word document python
Examples
Example 1
Input:
Write 'Vanakkam' in Tamil to a docx file.
Output:
Code snippet using add_run and setting run.font.name.