在创建ipython下拉窗口小部件时,
$stmt = $db->prepare("SELECT image FROM candidates WHERE idno = ?");
$stmt->bind_param("i", $_POST["candidateid"]);
$stmt->execute();
$stmt->bind_result($image); /* GET THE CORRESPINDING IMAGE */
$stmt->fetch();
$stmt->close();
echo '<img src="/system/admin/savephp/images/'.$image.'">'; /* WHAT YOU ECHO IS WHAT WILL BE RETURNED IN YOUR MAIN FILE */
我可以用
from IPython.html import widgets
from IPython.display import display
d = {"1": "a", "2": "b"}
dropdown = widgets.Dropdown(options=d)
display(dropdown)
从下拉窗口小部件中打印所选键的值。如何获取在下拉列表中单击的键(&#34; 1&#34;,&#34; 2&#34;)?使用
print dropdown.value
不起作用。