标题:请教调用函数问题:如何能把ssha的值在SSHA的框中输出呢?代码如下
只看楼主
sywzh
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-8-3
 问题点数:0 回复次数:0 
请教调用函数问题:如何能把ssha的值在SSHA的框中输出呢?代码如下
import sys
from PyQt4 import QtGui,QtCore
class GridLayout(QtGui.QWidget):
    def run(self):
       ssha=55
       return ssha
    def __init__(self,parent = None):
        QtGui.QWidget.__init__(self)
        self.setWindowTitle('Result!')
        id1 =QtGui.QLabel('ID')
        pw1=QtGui.QLabel('Password')
        ssha1=QtGui.QLabel('SSHA')
        self.id1 =QtGui.QLineEdit('5')
        self.pw1=QtGui.QLineEdit()
        self.ssha1 =QtGui.QLineEdit()
        quit=QtGui.QPushButton('close',self)
        quit.setGeometry(500,380,60,35)
        self.connect(quit,QtCore.SIGNAL('clicked()'),QtGui.qApp,QtCore.SLOT('quit()'))
        grid=QtGui.QGridLayout()
        grid.setSpacing(10)
        grid.addWidget(id1,1,0)
        grid.addWidget(self.id1,1,1)
        #self.id1.setText('5')
        grid.addWidget(pw1,2,0)
        grid.addWidget(self.pw1,2,1)
        #self.pw1.setText('5')
        grid.addWidget(ssha1,3,0)
        grid.addWidget(self.ssha1,3,1)
        self.setLayout(grid)
        self.resize(600,445)
    def base_run(self):
        self.run()
        id=self.run
        self.ssha1.setText(id)

app=QtGui.QApplication(sys.argv)
qb=GridLayout()
qb.show()
sys.exit(app.exec_())
搜索更多相关主题的帖子: return import parent 
2012-08-03 10:26



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-374633-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.719378 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved