ahoj, dělám si teďka takovou utilitu do linuxu.
Potřebuju aby se pustil kwrite po kliknutí na button...
from qt import *
from launcher import *
from os import *
import sys
if __name__ == "__main__":
app = QApplication(sys.argv)
f = Form1()
f.show()
app.setMainWidget(f)
app.exec_loop()
class Form1(QDialog):
def __init__(self,parent = None,name = None,modal = 0,fl = 0):
QDialog.__init__(self,parent,name,modal,fl)
if not name:
self.setName("Form1")
self.pushButton1 = QPushButton(self,"pushButton1")
self.pushButton1.setGeometry(QRect(200,30,221,101))
self.languageChange()
self.resize(QSize(600,170).expandedTo(self.minimumSizeHint()))
self.clearWState(Qt.WState_Polished)
self.connect(self.pushButton1,SIGNAL("clicked()"),self.pustkwrite)
... vynechano...
def pustkwrite(self):
spawnl(P_NOWAIT, "kwrite")
...vynechano...
sice importuji modul os, ale skoncim na chybe
[easy@easy_burn launcher]$ python launcher.py
Traceback (most recent call last):
File "/home/easy/workspace/launcher/launcher.py", line 51, in pustkwrite
spawnlp(P_NOWAIT, kwrite)
NameError: global name 'P_NOWAIT' is not defined
podle oficialni dokumentace je syntaxe:
spawnl(mode, file, *args)
viz.http://pydoc.org/1.6/os.html#-spawnl
čekám, že v tom bude nějaká má blbost, ale uz fakt nevím.... děkuji za pomoc