Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #39050
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <phil_lor@bigpond.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'exception': 0.03; '"""': 0.05; 'none,': 0.05; 'sys': 0.05; '"__main__":': 0.07; '-*-': 0.07; '__name__': 0.07; 'constructor': 0.07; 'line:': 0.07; 'none):': 0.07; 'raised': 0.07; 'try:': 0.07; 'utf-8': 0.07; 'coding:': 0.09; 'importerror': 0.09; 'subject:module': 0.09; 'unhandled': 0.09; 'def': 0.10; 'gui': 0.11; 'tutorials': 0.15; '200)': 0.16; 'debugged': 0.16; 'lambda': 0.16; 'quite.': 0.16; 'skip:q 30': 0.16; 'subject:Eric': 0.16; '\xe9crit': 0.16; 'wrote:': 0.17; 'example.': 0.17; 'app': 0.19; 'feb': 0.19; 'module': 0.19; 'changes': 0.20; 'followed': 0.20; 'import': 0.21; 'combination': 0.22; 'file:': 0.22; 'finally,': 0.22; 'originally': 0.23; "haven't": 0.23; "i've": 0.23; 'script': 0.24; 'tried': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'skip:s 60': 0.27; 'received:10.0.0': 0.28; '"no': 0.29; 'mini': 0.29; 'name?': 0.29; 'parent': 0.29; 'skip:m 60': 0.29; 'skip:q 20': 0.29; 'skip:_ 10': 0.29; 'class': 0.29; 'this.': 0.29; "i'm": 0.29; 'error': 0.30; 'code': 0.31; 'file': 0.32; "skip:' 20": 0.32; 'could': 0.32; 'message.': 0.33; 'goes': 0.33; 'skip:s 30': 0.33; 'received:10.0': 0.33; 'to:addr:python- list': 0.33; 'entered': 0.34; 'list': 0.35; 'auto': 0.35; 'eric': 0.35; 'except': 0.36; 'skip:u 20': 0.36; 'but': 0.36; 'skip:m 40': 0.36; 'anything': 0.36; 'thank': 0.36; 'execute': 0.37; 'two': 0.37; 'subject:: ': 0.38; 'received:10': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'think': 0.40; 'your': 0.60; 'skip:u 10': 0.60; 'between': 0.63; 'show': 0.63; 'decided': 0.65; 'risk': 0.66; 'day': 0.73; 'miss': 0.75; 'received:61': 0.75; '2013': 0.84; 'phil': 0.91 |
| X-Authentication-Info | Submitted using ID phil_lor@bigpond.com |
| X-Authority-Analysis | v=2.0 cv=IccFqBWa c=1 sm=1 a=r0Ls7xMWKGX29xsnPpVh5g==:17 a=pTzqZbqM9tkA:10 a=MOzFx5yvoRIA:10 a=JDadKst33uMA:10 a=8nJEP1OIZ-IA:10 a=1IlZJK9HAAAA:8 a=KFqS28IsKKMA:10 a=BawKZVwp1gYRGR9k5AUA:9 a=wPNLvfGTeEIA:10 a=r0Ls7xMWKGX29xsnPpVh5g==:117 |
| Date | Mon, 18 Feb 2013 09:04:23 +1000 |
| From | Phil <phil_lor@bigpond.com> |
| User-Agent | Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: Eric - "No module named MainWindow" |
| References | <51209E06.5070003@bigpond.com> <5120C085.1060101@swing.be> |
| In-Reply-To | <5120C085.1060101@swing.be> |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1912.1361146776.2939.python-list@python.org> (permalink) |
| Lines | 109 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1361146776 news.xs4all.nl 6855 [2001:888:2000:d::a6]:42111 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:39050 |
Show key headers only | View raw
On 17/02/13 21:35, Vincent Vande Vyvre wrote:
> Le 17/02/13 10:08, Phil a écrit :
>> Thank you for reading this.
>>
>> I've been playing with Eric all day and I almost have a working GUI
>> application, but not quite. I have followed the two tutorials on the
>> Eric site and I'm sure that I haven't miss entered anything and so I
<cut>
> Are you sure you have a class MainWindow in your ui.MainWindow.py ?
>
> Can you show us the code of this MainWindow ?
Thank you Vincent and Joel. I think I have already tried every
conceivable combination but I still cannot get past the error message.
At the risk of burdening the list with lots of code I have decided to
show the code as it stands. It's substantially that from the mini
browser example.
This is the auto generated code for Ui_mainWindow.py:
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file
'/home/phil/mainWindow.ui'
#
# Created: Sun Feb 17 15:54:33 2013
# by: PyQt4 UI code generator 4.9.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(200, 200)
self.centralWidget = QtGui.QWidget(MainWindow)
self.centralWidget.setObjectName(_fromUtf8("centralWidget"))
self.pushButton = QtGui.QPushButton(self.centralWidget)
self.pushButton.setGeometry(QtCore.QRect(40, 120, 91, 24))
self.pushButton.setObjectName(_fromUtf8("pushButton"))
MainWindow.setCentralWidget(self.centralWidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow",
"MainWindow", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton.setText(QtGui.QApplication.translate("MainWindow",
"PushButton", None, QtGui.QApplication.UnicodeUTF8))
if __name__ == "__main__":
import sys
app = QtGui.QApplication(sys.argv)
MainWindow = QtGui.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())
This is the code for mainWindow.py"
class MainWindow(QMainWindow, Ui_MainWindow):
"""
Class documentation goes here.
"""
def __init__(self, parent = None):
"""
Constructor
"""
QMainWindow.__init__(self, parent)
self.setupUi(self)
And this is the main script that I had originally used and named new_gui.py:
from PyQt4 import QtCore, QtGui
from ui.MainWindow import MainWindow
if __name__ == "__main__":
import sys
app = QtGui.QApplication(sys.argv)
ui = MainWindow()
ui.show()
sys.exit(app.exec_())
Finally, for completeness, this is the error message when I attempt to
execute new_gui.py:
The debugged program raised the exception unhandled ImportError
"No module named mainWindow"
File: /home/phil/new_gui.py, Line: 2
Could it simply be a case of conflict between my file names and the
module name?
--
Regards,
Phil
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Eric - "No module named MainWindow" Phil <phil_lor@bigpond.com> - 2013-02-18 09:04 +1000
csiph-web