O
O
ObehanProger2019-06-23 10:40:14
PyQt
ObehanProger, 2019-06-23 10:40:14

How to call a terminal in a pyqt application and execute a command in it?

There is a desktop mini-application for linux with a button:

#!/usr/bin/python
# coding=utf-8
import sys
from qt import *
a = QApplication(sys.argv)
# Наша функция, которая будет вызвана при нажатии на кнопку

#создание кнопки
btn = QPushButton("Выполнить",None)
#назначить обработчик

a.setMainWidget(btn)
btn.show()
a.exec_loop()

How can I make it so that when the button is pressed, the terminal opens and the command "cd / home" is executed in it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Michurin, 2019-06-23
@denistu10

Answer given here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question