37 from python_qt_binding.QtCore
import QProcess, QTimer, Signal
38 from python_qt_binding.QtGui
import QX11EmbedContainer
42 xterm_cmd =
'/usr/bin/xterm' 43 close_signal = Signal()
45 def __init__(self, parent=None, script_path=None):
48 xterm_cmd +=
" -e $SHELL -c 'source %s; $SHELL'" % os.path.abspath(script_path)
49 super(XTermWidget, self).
__init__(parent)
50 self.setObjectName(
'XTermWidget')
57 args = [
'-into', str(self.winId())]
59 if self._process.error() == QProcess.FailedToStart:
60 print(
"failed to execute '%s'" % self.
xterm_cmd)
64 self._process.waitForFinished()
68 return os.path.isfile(XTermWidget.xterm_cmd)
70 if __name__ ==
'__main__':
71 from PyQt4.QtGui
import QApplication
72 app = QApplication([])