|
2011-08-21
, 19:44
|
Posts: 662 |
Thanked: 653 times |
Joined on Feb 2010
|
#2
|
The Following User Says Thank You to Reffyyyy For This Useful Post: | ||
|
2011-08-21
, 20:16
|
Posts: 144 |
Thanked: 68 times |
Joined on Mar 2011
@ a spot
|
#3
|
Can be done easily in Qt. You're going to want to use QWidget (obviously), QPushButton, and QProcess. You'll also probably want any of the layout classes.
You could also do it in QML, but you'll need to integrate Qt/C++ in order to actually execute the commands. QML doesn't have a QProcess equivalent.
|
2011-08-21
, 20:46
|
|
Posts: 2,448 |
Thanked: 9,523 times |
Joined on Aug 2010
@ Wigan, UK
|
#4
|
The Following User Says Thank You to marxian For This Useful Post: | ||
|
2011-08-21
, 20:56
|
Banned |
Posts: 726 |
Thanked: 497 times |
Joined on Aug 2010
@ Gravesend, UK
|
#5
|
|
2011-08-21
, 21:47
|
|
Moderator |
Posts: 2,622 |
Thanked: 5,447 times |
Joined on Jan 2010
|
#6
|
#!/usr/bin/python from PyQt4 import QtGui import sys import os g=QtGui app=g.QApplication(sys.argv) window= g.QWidget() label=g.QLabel('hw') button=g.QPushButton('run vi') button.clicked.connect(lambda: os.system('vi')) layout = g.QVBoxLayout() window.setLayout(layout) layout.addWidget(label) layout.addWidget(button) window.show() sys.exit(app.exec_())
|
2011-08-21
, 21:51
|
Posts: 1,751 |
Thanked: 844 times |
Joined on Feb 2010
@ Sweden
|
#8
|
|
2011-08-22
, 16:29
|
Posts: 37 |
Thanked: 191 times |
Joined on Nov 2009
@ Finland
|
#9
|
So I decided I want to make an app, a very simple one. It would be a window, with buttons, and each button executes a command in xterm while in root. Commands that I will need will be wget, tar, cd, bzip2...
Anybody's help?