当前位置: 首页>>代码示例>>Python>>正文


Python Document.save方法代码示例

本文整理汇总了Python中Document.Document.save方法的典型用法代码示例。如果您正苦于以下问题:Python Document.save方法的具体用法?Python Document.save怎么用?Python Document.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Document.Document的用法示例。


在下文中一共展示了Document.save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test2

# 需要导入模块: from Document import Document [as 别名]
# 或者: from Document.Document import save [as 别名]
def test2():
    cnf = QConfiguration()

    cnf.get_configuration('.','exam.cfg')

    print cnf._title
    print cnf._course
    print cnf._date

    doc = Document(cnf)

    doc.save('/home/javier/tmp', 'test')
开发者ID:bejar,项目名称:ExerQuizGen,代码行数:14,代码来源:test.py

示例2: test3

# 需要导入模块: from Document import Document [as 别名]
# 或者: from Document.Document import save [as 别名]
def test3():
    col = QCollection()
    col.load_qcollection('.', 'questions')
    quiz = Quiz()
    col.pprint()


col = QCollection()
col.load_qcollection('.', 'questions')
qz = col.generate_quiz(3, 3)

# for i in range(qz.size()):
#     qu = qz.get_i_question(i)
#     print qu.get_qtext(), qu.len_qchoices()
#     for j in range(qu.len_qchoices()):
#         print qu.get_i_qchoice(j)


cnf = QConfiguration()
cnf.get_configuration('.', 'exam.cfg')

print cnf._instructions.split('#')

d = Document(cnf, qz)

d.save('test', 2)



开发者ID:bejar,项目名称:ExerQuizGen,代码行数:28,代码来源:test.py

示例3: open

# 需要导入模块: from Document import Document [as 别名]
# 或者: from Document.Document import save [as 别名]
col.load_qcollection(cnf.get_questions_path(), cnf.get_questions_collection())

dnifile = open(dnipath + '/' + 'DNI1617' + '.txt', 'r')
if not os.path.exists(cnf.get_output_path()):
    os.mkdir(cnf.get_output_path())
    os.mkdir(cnf.get_output_path() + '/test')
    os.mkdir(cnf.get_output_path() + '/solution')

os.system(' rm -fr ' + cnf.get_output_path() + '/test/*')
os.system(' rm -fr ' + cnf.get_output_path() + '/solution/*')

for values in dnifile:
    dni, famname, firstname  = values.split(',')
    qz = col.generate_quiz(cnf.get_exam_num_questions(), cnf.get_exam_num_answers(), seed=int(dni))
    d = Document(cnf, qz)
#    d.save(cnf.get_exam_file_name()+'-'+stripNl(dni), cnf.get_exam_num_choices(),solutions=True, stdname=firstname.upper() + " " + famname.upper())
    d.save(cnf.get_exam_file_name()+'-'+dni, cnf.get_exam_num_choices(),solutions=True)
    os.system('pdflatex -output-directory '+ cnf.get_output_path() +
              '/test/ '+ cnf.get_output_path() + '/test/' + cnf.get_exam_file_name() + '-' + dni + '.tex')
    os.system('pdflatex -output-directory '+ cnf.get_output_path() +
              '/solution/ ' + cnf.get_exam_file_name() + '-' + dni + '-sol.tex')
    os.system('pdflatex -output-directory '+ cnf.get_output_path() +
              '/solution/ ' + cnf.get_exam_file_name() + '-' + dni + '-sol.tex')
ext = ['log','aux', 'out', 'qsl', 'sol', 'cut', 'djs']
for e in ext:
    os.system(' rm -fr ' + cnf.get_output_path() + '/test/*.' + e)
    os.system(' rm -fr ' + cnf.get_output_path() + '/solution/*.' + e)

os.system('cd '+ cnf.get_output_path() + '/test/' +'; zip ' + cnf.get_exam_file_name() + '.zip *.pdf')
os.system('cd '+ cnf.get_output_path() + '/solution/' +'; zip ' + cnf.get_exam_file_name() + '-sol.zip *.pdf')
开发者ID:bejar,项目名称:ExerQuizGen,代码行数:32,代码来源:GenerateTests.py


注:本文中的Document.Document.save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。