Qt 6.11 is out! See what's new in the release
blog
self.text_console.append(line) not work
-
class ServerConsolePage(QMainWindow): def __init__(self, parent): super(ServerConsolePage, self).__init__(parent) uic.loadUi(".\ServerConsolePage.ui", self) #보여주기 self.show() #이름 self.setWindowTitle('통합 서버 구동기 - 서버 콘솔') #크기 self.setGeometry(300, 300, 300, 200) self.setFixedSize(1100, 700) # The display effect is the same as executing in the command window, if there is color output, it can be kept, but the result cannot be returned def run(command): subprocess.call(command, shell=True) run("ipconfig") # Real-time output but not color display, you can return the result def sh(command, print_msg=True): p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) lines = [] for line in iter(p.stdout.readline, b''): line = line.rstrip().decode('utf8') if print_msg: global Save_text_console Save_text_console = line self.text_console.append(line) lines.append(line) return linesThere's a self.text_console.append(line) in the function.
is not working
Or is there a way to make that work? -
Hi,
What do you mean by not working ?
Did you check that you actually get something ?
What's the content of the lines variable that you return from that method ?