471,123 Members | 854 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,123 software developers and data experts.

Linux-Signal VS QT

Can I use LinuX signal as a tool for commuction with a QT(PyQt4) programme?

The follow code didNOT work...
from PyQt4 import QtCore,QtGui
import signal
import sys
import os

try:
import psyco
psyco.full()
except:
pass

class Main(QtGui.QWidget):
def __init__(self):
QtGui.QWidget.__init__(self)

self.frame = QtGui.QFrame(self)
self.label = QtGui.QLabel(str(os.getpid()), self.frame)
signal.signal(15, self.sig_handler)
print signal.getsignal(15)

def sig_handler(self, signum, sframe):
print 'received!'
self.label.setText('haha')
self.show()

########################
# main routine #
########################
if __name__ == '__main__':
app = QtGui.QApplication(sys.argv)

main = Main()
main.show()
app.exec_()
--
LinuX Power
Feb 8 '07 #1
0 961

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Jhuola Hoptire | last post: by
21 posts views Thread by Travis 'Bailo' Bickel | last post: by
5 posts views Thread by cranium.2003 | last post: by
1 post views Thread by rada.lambretha | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.