Re: [Tutor] Classes in multiple files - code included

2013-04-04 Thread Alan Gauld
On 04/04/13 08:51, Phil wrote: By the way, I notice that it can take several hours for my postings to appear on the list. Possibly due to moderation? Nope, the only posts that get moderated are the ones where the poster has not subscribed to the list (or is using a different email address th

Re: [Tutor] Classes in multiple files - code included

2013-04-04 Thread Steven D'Aprano
On 04/04/13 13:12, Phil wrote: On 04/04/13 11:58, Steven D'Aprano wrote: On 04/04/13 12:47, Phil wrote: And this is the error message; "global name 'Ui_satListDialog' is not defined" On its own, that is almost useless. Python gives you more debugging information than that: it gives you a c

Re: [Tutor] Classes in multiple files - code included

2013-04-04 Thread Phil
On 04/04/13 16:58, Peter Otten wrote: Phil wrote: I think I must be very close now so I'll post just the code that I think is relevant. This the main window class: import satListDialog Here you are importing the module "satListDialog" class MainWindow(QMainWindow, Ui_MainWindow): This

Re: [Tutor] Classes in multiple files - code included

2013-04-03 Thread Peter Otten
Phil wrote: > I think I must be very close now so I'll post just the code that I think > is relevant. > > This the main window class: > import satListDialog Here you are importing the module "satListDialog" > class MainWindow(QMainWindow, Ui_MainWindow): > > This is the function to show the

Re: [Tutor] Classes in multiple files - code included

2013-04-03 Thread Phil
On 04/04/13 11:58, Steven D'Aprano wrote: On 04/04/13 12:47, Phil wrote: And this is the error message; "global name 'Ui_satListDialog' is not defined" On its own, that is almost useless. Python gives you more debugging information than that: it gives you a complete traceback, which include

Re: [Tutor] Classes in multiple files - code included

2013-04-03 Thread Steven D'Aprano
On 04/04/13 12:47, Phil wrote: And this is the error message; "global name 'Ui_satListDialog' is not defined" On its own, that is almost useless. Python gives you more debugging information than that: it gives you a complete traceback, which includes the actual line of code causing the prob

Re: [Tutor] Classes in multiple files - code included

2013-04-03 Thread Phil
On 04/04/13 09:32, Alan Gauld wrote: Reme,ber that in python its the file name you need to use to import So if SatelliteListDialog is defined in satellite.py you need import satellite in your main window file. And satellite.py has to be in your library path too... The Eric IDE must take ca

Re: [Tutor] Classes in multiple files

2013-04-03 Thread Phil
On 04/04/13 09:32, Alan Gauld wrote: On 04/04/13 00:14, Phil wrote: If this was C++ then I'd need to include a class header and so I'm thinking that an import statement is needed in the main window class referring to the dialog class. Import SatelliteListDialog isn't correct. Reme,ber that in

Re: [Tutor] Classes in multiple files

2013-04-03 Thread Alan Gauld
On 04/04/13 00:14, Phil wrote: If this was C++ then I'd need to include a class header and so I'm thinking that an import statement is needed in the main window class referring to the dialog class. Import SatelliteListDialog isn't correct. Reme,ber that in python its the file name you need to

[Tutor] Classes in multiple files

2013-04-03 Thread Phil
Thank you for reading this. The recent question relating to classes has prompted to ask this one. I have a main window class and a dialog class and they are defined in separate files. I'm attempting to display the dialog when a menu item is selected in the main window but it doesn't work becau