Meaning of these arguments?
<p>I use a flashcard program called Anki, which is written in Python. I want to write my first add-on. I'm new to Python. I'm not a techie, but I have a few years experience of jumping around inside other people's code in Java, C++, C#, and so on.</p>

<p>The flash card shows a question, for example "Capital of France?". When the "Show Answer" button is pressed, Anki displays the answer "Paris".</p>

<p>I want to grab this text "Paris", before it's shown.</p>

<p>I've arrived at this point in the Anki code. At this instant, the card shows "Capital of France?". The answer is still blank. I think I want to be able to grab  "val" (which I think is "Paris") and use it in my add-on.</p>

<pre><code>def _getTypedAnswer(self):
    self.web.evalWithCallback("typeans ? typeans.value : null", self._onTypedAnswer)

def _onTypedAnswer(self, val):
    self.typedAnswer = val        
    self._showAnswer()
</code></pre>

<p>I've been googling to try to find the meaning of this:</p>

<pre><code>("typeans ? typeans.value : null", self._onTypedAnswer)
</code></pre>

<p>I have access to all the code, and I can provide any code that might be useful to responders.</p>

<p>Thanks.</p>

<hr>

<p>Added: after questions from responders.</p>

<p>Anki can be run on a computer or on the internet. All the results of studying cards are synced, so there's no difference between one method or the other as far as the end user is concerned.</p>

<hr>

<p>From the "webview" class:</p>

<pre><code>def evalWithCallback(self, js, cb):
    self.page().runJavaScript(js, cb)
</code></pre>

<hr>

<p>The "reviewer" class shows the questions and answers. The reviewer window is "mw" (for "main window")</p>

<p>Here's the init statement for class "reviewer"</p>

<pre><code>def __init__(self, mw):
    self.mw = mw
    self.web = mw.web
</code></pre>

<p><code>typeans ? typeans.value : null</code> is a <code>C/C++/C#</code> (and probably Java too, can't remember) code equivalent to (pseudo-code)</p>

<pre><code>if typans:
   return typeans.value
else:
   return null
</code></pre>

<p><code>("typeans ? typeans.value : null", self._onTypedAnswer)</code> is a tuple that contains this line of code as a string.</p>

python anki