Python中文
首页
教程
问答
标签
搜索
登录
注册
Pyforms AttributeError:“模块”对象没有属性“start\u app”
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>在我的Raspberry pi3上安装了pyforms之后,我尝试运行在<a href="http://pyforms.readthedocs.io/en/v2.0/getting-started/the-basic/#the-basic" rel="nofollow noreferrer">readthedocs</a>上找到的示例,但是应用程序抛出了一个<code>AttributeError</code>(我尝试了python2和python3)</p> <hr/> <p><strong>Python代码</strong></p> <pre><code>import pyforms from pyforms import BaseWidget from pyforms.Controls import ControlText from pyforms.Controls import ControlButton class SimpleExample1(BaseWidget): def __init__(self): super(SimpleExample1,self).__init__('Simple example 1') #Definition of the forms fields self._firstname = ControlText('First name', 'Default value') self._middlename = ControlText('Middle name') self._lastname = ControlText('Lastname name') self._fullname = ControlText('Full name') self._button = ControlButton('Press this button') #Execute the application if __name__ == "__main__": pyforms.start_app( SimpleExample1 ) </code></pre> <hr/> <p><strong>错误:</strong></p> ^{pr2}$ <hr/> <hr/> <p><strong>编辑:</strong></p> <p>我试图用手动导入<code>start_app</code></p> <pre><code>from pyforms.gui.standaloneManager import start_app </code></pre> <p>但是我又得到了一个<code>ImportError</code>:</p> <pre><code>Traceback (most recent call last): File "PiControl.py", line 4, in <module> from pyforms.gui.standaloneManager import start_app ImportError: cannot import name 'start_app' </code></pre>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>在阅读了pyforms的github站点之后,我了解到它是一个web框架。 所以我认为它会像其他web框架一样。错误提示“module”没有“start_app”方法,因此我认为您可能没有声明应用程序实例。“start_app”应该属于web应用程序实例。 可能是错了,因为我没看过文件。在</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
如何替换子字符串,但前提是它正好出现在两个单词之间
7 回答
如何替换字典中所有出现的指定字符
4 回答
如何替换字典中所有键的第一个字符?
8 回答
如何替换字典所有键中的子字符串
8 回答
如何替换字符串python中的变量值?
8 回答
如何替换字符串Python中的第二次迭代
7 回答
如何替换字符串y Python中不等于字符串x的所有内容?
3 回答
如何替换字符串中出现的第n个单词?
2 回答
如何替换字符串中单词的一部分
8 回答
如何替换字符串中同时出现的2个或更多特殊字符或下划线
8 回答
如何替换字符串中指定位置(索引)的字符?
1 回答
如何替换字符串中某个字符的所有匹配项?
7 回答
如何替换字符串中的
2 回答
如何替换字符串中的一个字符
9 回答
如何替换字符串中的主题(固定位置)
4 回答
如何替换字符串中的分隔逗号?
3 回答
如何替换字符串中的列名(python)?
9 回答
如何替换字符串中的制表符?
10 回答
如何替换字符串中的单个单词而不是用相同的字符替换其他单词
3 回答
如何替换字符串中的单个字符?
8 回答