PDF页面/图像随机化器,或PDF中的抽认卡测验。
pdf-shuffle的Python项目详细描述
PDF随机播放
PDF页面/图像随机化器,或PDF中的抽认卡测验。或者随机化文件夹中的文件。
安装
$ pip install pdf-shuffle
用法
pdf shuffle附带两个cli应用程序:
$ pdf-shuffle --help
Usage: pdf-shuffle [OPTIONS] FILENAME
Options:
--start INTEGER
--end TEXT
--step INTEGER
--random / --no-random
--host TEXT
--port INTEGER
--help Show this message and exit.
$ pdf-shuffle test.pdf
而且,
$ pdf-quiz --help
Usage: pdf-quiz [OPTIONS] FILENAME
Options:
--start INTEGER
--end TEXT
--step INTEGER
--random / --no-random
--host TEXT
--port INTEGER
--help Show this message and exit.
$ pdf-quiz quiz.pdf
当然,您也可以从python脚本调用应用程序。
frompdf_shuffleimportinitinit('test.pdf')
或者,
frompdf_shuffleimportinit_quizinit_quiz('quiz.pdf')
您也可以在文件夹中随机放置文件:
frompdf_shuffleimportinitinit('test/')
高级用法
默认情况下,quiz.pdf
表示除第一张幻灯片外,每个第一张和第二张幻灯片分别位于卡的前面和后面。您可以更改此设置,方法是:
importos,jsonos.environ['PAGE_RANDOM']=json.dumps([2,3,5,9,12])
间隔重复系统(SRS)
如果您正在考虑使用srs扩展应用程序,您可以尝试srs-sqlite,这是我当前使用的。