本文整理汇总了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')
示例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)
示例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')