forked from EstravenX/anki2sm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qrun.py
43 lines (37 loc) · 1.84 KB
/
qrun.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from typing import List
import mustache
import Formatters
import Utils.Fonts as fonts
#qtext = """What is the key risk factor for Cervical Carcinoma?<div><br /></div><div>{{c1::High-risk HPV (16, 18, 31, 33)}}</div><div><i>HPV 16 and 18 account for more than 70% of all Cervical Carcinoma</i></div><div><i><br /></i></div><i><img src="paste-28157805593154.jpg" /></i>
#<img src="paste-344018290475011.jpg"><img src="paste-28630251995139.jpg"><img src="paste-341909461532675.jpg"><img src="paste-69376606732291.jpg"><img src="paste-66705137074179.jpg">
#<img src="paste-35699768164355.jpg"><i>Other:</i><div><div><i>-<b> smoking</b></i></div><div><i>- starting <b>sexual</b> intercourse at a <b>young</b> age</i></div><div><i>-<b> immunodeficiency</b> (eg. HIV infection)</i></div></div>"""
#q = qtext.split(r"")
#fonts.install_font("C:/Users/polit/AppData/Local/Temp/smmedia/_YUMIN.TTF")
#import glob
#print(glob.glob("C:\\Users\\polit\\AppData\\Local\\Temp\\smmedia\\*.ttf"))
#
# mustache.filters["cloze"] = lambda txt: Formatters.cloze_q_filter(txt, str(int(0) + 1))
#
# mytemplate = "{{#Text}}{{cloze:Text}}{{/Text}}"
#
# print(mustache.render(mytemplate,{"Text": q[0]}))
# from MediaConverter import MediaConverter
#
# mc = MediaConverter()
# mc.convertImage("C:\\Users\\polit\\Desktop\\anki2sm\\out\\out_files\\elements\\Freesample.svg")
# def lastStoneWeightII( stones: List[int]) -> int:
# total = sum(stones)
#
# Max_weight = int(total / 2)
# print("Max Weight",Max_weight)
# current = (Max_weight + 1) * [0]
#
# for stone in stones:
# for wgt in range(Max_weight, -1, -1):
# if wgt - stone >= 0:
# current[wgt] = max(stone + current[wgt - stone], current[wgt])
# print(stone, wgt, current)
# #print("Matrix value:\n",current)
# return total - 2 * current[-1]
#
# lastStoneWeightII([2,7,4,1,8,1])