[PyKDE] What little detail am I missing?

Tina Isaksen tina at bestemselv.com
Thu Feb 9 13:40:55 GMT 2006


Ok, an even simpler thing: Take the innput and print it in a terminal. 
And I can't even do that so I must be missing something so basic that 
it's probably redicilous. I have read examples, webpages etc and I just 
don't get it!!! :(

My program named "enkeltestMain"

from qt import *
from  enkeltest import *
import sys

class click(enkelTest):
    def __init__(self):
        test = innput
        return test
 
def prog():
    print test

if __name__ == "__main__":
    app = QApplication(sys.argv)
    f = enkelTest()
    f.show()
    app.setMainWidget(f)
##    click()               this is something I tried
##    prog()
    app.exec_loop()


-----------------------------------------------------------------------------------

My "enkeltest.ui.h"

void enkelTest::click()
{
innput=self.lineEdit1.text().toInt()
return innput
}

-----------------------------------------------------------------------------------

I run pyuic enkeltest.ui > enkeltest.py

Errormessage when trying to run "enkeltestMain":
The debugged program raised the exception unhandled NameError
"global name 'test' is not defined"

Maybe old dogs really can't learn new tricks...  :/

Thanks
Tina




More information about the PyQt mailing list