<p>我写了以下代码来创建布局并在布局中显示一些文本。接下来,使用urwid库中的原始显示模块在控制台屏幕上显示布局。
但是运行代码失败了,因为它找不到我在类中单独编写的函数<strong>main</strong>。在</p>
<p>运行时的错误代码是:</p>
<pre><code>Traceback (most recent call last):
File "./yamlUrwidUIPhase5.py", line 89, in <module>
main()
File "./yamlUrwidUIPhase5.py", line 83, in main
FormDisplay().main()
AttributeError: 'NoneType' object has no attribute 'main'
</code></pre>
<p>代码:</p>
^{pr2}$