Example #1
0
def story():
    file_path = askdirectory()
    docx1 = docx.Document()

    docx1.add_heading("escape room story", 0)
    docx_par = docx1.add_paragraph("The story of the game")
    docx_par.alignment = WD_ALIGN_PARAGRAPH.RIGHT
    docx.add_run("""
        שלום, אתם בשנת 2174 וכל העולם נדבק בוירוס בשם LCA-100, רק אתם יכולים להציל אותו, אבל, תצטרכו לפתור את החידות הבאות בשביל להציל את העולם, חידות אלו הן חידות שאפילו אני לא הצלחתי לפתור והם יעזרו לכם להגיע למקור המחלה ולהציל את האנושות, אני בניתי מכונת זמן אשר תיקח אתכם ליעד הראשון, 1 למאי, 2028, שם נמצא האדם הראשון לחלות במחלה, אתם תצטרכו לאתר אותו בשביל למנוע ממנו לראות אנשים אחרים במשך חודש, אני לא יכול לספר לכם יותר מזה.
את השאר אתם תצטרכו להבין לבד, מבחינת הזמן שלכם, יש לכם חצי שעה לפתור את החידות.
בהצלחה בדרך, רמז: לכל אחד מהאנשים שתמצאו יש מחלה שונה בקצת מהשני. 
""")
    docx.add_run("בהצלחה")
    os.chdir(file_path)
    docx.save(file_path)
Example #2
0
from plasTeX.TeX import TeX
from lxml import etree
import ct, docx
from common import Document
import sys, os

try:
    tf = sys.argv[1]
except:
    print 'useage: Latex2docx texfile'
    sys.exit(0)

try:
    df = os.path.splitext(tf)[0]
    td = TeX(file=tf)
    td = td.parse()
    ct.cnd(td)
    docx.save(df)
except OSError as oe:
    print oe
except IOError as oe:
    print oe
Example #3
0
from plasTeX.TeX import TeX
from lxml import etree
import ct, docx
from common import Document

td = TeX(file='nt.tex')
td = td.parse()

print
print td.toXML()

print
ct.cnd(td)

#print etree.tostring(Document, encoding='utf-8', xml_declaration=True, standalone=True, pretty_print=True)

docx.save('sd')