Hi guys, it's been a while since I posted and I've learned a lot since then.
Today I have a question on classes, I can't get mine to work.
class alist(list):
def __init__(self, b, a):
self = list()
self.append(b)
a = a + b
def appendit(self):
self.append(a)
print(alist(2,4))
[]
#It's blank
On 04/03/2013 03:43 PM, frank ernest wrote:
Hi guys, it's been a while since I posted and I've learned a lot since then.
Today I have a question on classes, I can't get mine to work.
Welcome back. I'll try. First comment is that indentation ought to be
4 columns, until you have enough exper
On 03/04/13 20:43, frank ernest wrote:
Hi guys, it's been a while since I posted and I've learned a lot since
then. Today I have a question on classes, I can't get mine to work.
Dave has already addressed many issues but there are a few more to consider
class alist(list):
def __init__(s
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
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
Hi all,
I'm having a doubt in the below program's 2n'd "for" loop.
>>> for n in range(2, 10):
... for x in range(2, n):
... if n % x == 0:
... print n, 'equals', x, '*', n/x
... break
... else:
... # loop fell through without finding a factor
...
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
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
On 04/04/13 12:29, bessenkphilip wrote:
Hi all,
I'm having a doubt in the below program's 2n'd "for" loop.
for n in range(2, 10):
... for x in range(2, n):
... if n % x == 0:
... print n, 'equals', x, '*', n/x
... break
... else:
... # loop fell
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
On 04/03/2013 09:53 PM, Steven D'Aprano wrote:
On 04/04/13 12:29, bessenkphilip wrote:
Hi all,
I'm having a doubt in the below program's 2n'd "for" loop.
for n in range(2, 10):
... for x in range(2, n):
... if n % x == 0:
... print n, 'equals', x, '*', n/x
...
I believe Dave answered the OP's intended question.
On Apr 3, 2013 9:54 PM, "Dave Angel" wrote:
> On 04/03/2013 09:53 PM, Steven D'Aprano wrote:
>
>> On 04/04/13 12:29, bessenkphilip wrote:
>>
>>> Hi all,
>>>
>>> I'm having a doubt in the below program's 2n'd "for" loop.
>>>
>>> for n in range(2
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
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
14 matches
Mail list logo