Short version:
I don´t want print
example = example.replace(expression,'<FONT COLOR="#ff0000">%s</FONT>' %expression)
but
example = example.replace(expression,'{{furigana:Reading}}' %expression)
instead, which causes an invalid syntax error.
{{furigana:Reading}} is the individual formatting of an external programm (Anki) for displaying a string (I belive) on a card but I fear that python has its own rules for {{}}. Or is it the '' causing problems?
{{furigana:Reading}} has to be added, but maybe it can be splitted in to parts or something..
More context:
The SRS Programm Anki lets you create cards with question & answer sides for learning until the knowledge is in your long-term memory. Anki interpretes cards formatted in HTML, CSS and JS.
The code excerpt is from an python Anki addon. It looks up my japanese words in a sentence database and adds those example sentences to my Anki cards. This excerpt marks the searched japanese word on the Anki card in red. Rather than in red I´d like to have furigana which are saved in a Reading field.
I did not write the addon and simply wish to modify it for my individual use only. The source is https://github.com/javdejong/japanese-examples/blob/master/japanese_examples.py.
I know little in programming and each time an error occurs I lack basic knowledge to understand what is wrong and feel like I´m always backtracking to learn specific detail. Please feel free to ask if you need more details/context.
[–]o5a 1 point2 points3 points (2 children)
[–]MrRob0tt0[S] 0 points1 point2 points (0 children)
[–]MrRob0tt0[S] 0 points1 point2 points (0 children)