• <bdo id='qlZmY'></bdo><ul id='qlZmY'></ul>
    <legend id='qlZmY'><style id='qlZmY'><dir id='qlZmY'><q id='qlZmY'></q></dir></style></legend>

    1. <small id='qlZmY'></small><noframes id='qlZmY'>

        <i id='qlZmY'><tr id='qlZmY'><dt id='qlZmY'><q id='qlZmY'><span id='qlZmY'><b id='qlZmY'><form id='qlZmY'><ins id='qlZmY'></ins><ul id='qlZmY'></ul><sub id='qlZmY'></sub></form><legend id='qlZmY'></legend><bdo id='qlZmY'><pre id='qlZmY'><center id='qlZmY'></center></pre></bdo></b><th id='qlZmY'></th></span></q></dt></tr></i><div id='qlZmY'><tfoot id='qlZmY'></tfoot><dl id='qlZmY'><fieldset id='qlZmY'></fieldset></dl></div>
        <tfoot id='qlZmY'></tfoot>
      1. Python,Kivy,“AssertionError: None is not callable"按

        时间:2023-10-09
          <tbody id='G2KeV'></tbody>

            1. <i id='G2KeV'><tr id='G2KeV'><dt id='G2KeV'><q id='G2KeV'><span id='G2KeV'><b id='G2KeV'><form id='G2KeV'><ins id='G2KeV'></ins><ul id='G2KeV'></ul><sub id='G2KeV'></sub></form><legend id='G2KeV'></legend><bdo id='G2KeV'><pre id='G2KeV'><center id='G2KeV'></center></pre></bdo></b><th id='G2KeV'></th></span></q></dt></tr></i><div id='G2KeV'><tfoot id='G2KeV'></tfoot><dl id='G2KeV'><fieldset id='G2KeV'></fieldset></dl></div>
              <legend id='G2KeV'><style id='G2KeV'><dir id='G2KeV'><q id='G2KeV'></q></dir></style></legend>

              <tfoot id='G2KeV'></tfoot>

              <small id='G2KeV'></small><noframes id='G2KeV'>

                • <bdo id='G2KeV'></bdo><ul id='G2KeV'></ul>
                  本文介绍了Python,Kivy,“AssertionError: None is not callable"按钮调用函数时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  所以我想使用此代码在按下按钮时调用函数:

                  So I whant to use this code to call a function on a button press:

                  botao_ok.bind(on_press=f_adicionar_socios(txt_n_socio.text,txt_nome.text,txt_filho_de.text,txt_filho_e_de.text,txt_data_nas.text,txt_tipo_ID.text,txt_num_ID.text,txt_NIF.text,txt_morada_rua.text,txt_morada_localidade.text,txt_codigo_postal.text,txt_tel_fixo.text,txt_telemovel.text,txt_email.text,txt_tipo_socio.text,txt_data_admicao.text,txt_zona.text,txt_actividade.text,txt_actividade_de.text,txt_actividade_ate.text,txt_observacoes.text))
                  

                  但为了简单起见,我只需要解决这个问题:

                  But to keep it simple, I only need to solve this problem:

                  #My Function
                  def teste_(nome):
                      print nome
                  #Button
                  botao_ok.bind(on_press=teste_('Ola'))
                  # Button is inside a Class MYApp
                  

                  它给出了错误:AssertionError: None is not callable

                  and it gives the error: AssertionError: None is not callable

                  我已经尝试了所有我强硬的方法但无法解决这个问题......谢谢

                  Ive tryied everything I tough off and can't solve this... Thank you

                  推荐答案

                  当你编写 teste_('Ola') 函数运行并返回 None

                  When you write teste_('Ola') the function runs and returns None

                  所以当你写的时候

                  botao_ok.bind(on_press=teste_('Ola'))
                  

                  它实际上被设置为:

                  botao_ok.bind(on_press=None)
                  

                  简而言之,这是导致您的问题的原因.

                  Which in short is causing your problem.

                  为了让它调用 teste_('Ola') 当按钮被按下时,你可以使用 lambda 函数:

                  In order to get it to call teste_('Ola') When the button is pressed, you could use a lambda function:

                  botao_ok.bind(on_press=lambda x:teste_('Ola'))
                  

                  这篇关于Python,Kivy,“AssertionError: None is not callable"按钮调用函数时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:具有多项选择的 kivy 微调器小部件 下一篇:Kivy/Python Countdown App 项目 kivy 没有属性 'built

                  相关文章

                  最新文章

                  <tfoot id='5TLP5'></tfoot>

                  • <bdo id='5TLP5'></bdo><ul id='5TLP5'></ul>
                  <legend id='5TLP5'><style id='5TLP5'><dir id='5TLP5'><q id='5TLP5'></q></dir></style></legend>

                  <small id='5TLP5'></small><noframes id='5TLP5'>

                  1. <i id='5TLP5'><tr id='5TLP5'><dt id='5TLP5'><q id='5TLP5'><span id='5TLP5'><b id='5TLP5'><form id='5TLP5'><ins id='5TLP5'></ins><ul id='5TLP5'></ul><sub id='5TLP5'></sub></form><legend id='5TLP5'></legend><bdo id='5TLP5'><pre id='5TLP5'><center id='5TLP5'></center></pre></bdo></b><th id='5TLP5'></th></span></q></dt></tr></i><div id='5TLP5'><tfoot id='5TLP5'></tfoot><dl id='5TLP5'><fieldset id='5TLP5'></fieldset></dl></div>