0

Alright so im wanting to create a pyqt gui that has little consoles inside the program that things can be printed to. let me explain further more. so if you would run a program without any gui interface like this

import os
name = raw_input("What is your name? ")
print "Hello " + str(name) = "How are you?"
os.system('pause')

everything would run inside of the cmd. i am wanting to make a pyqt gui that is basicly the cmd but i would like to add other buttons around the embedded console if someone could teach me how to make this that would be amazing. thank you so much in advance!

Tyrell
  • 896
  • 7
  • 15
  • 26

1 Answers1

-1

You're thinking too much into this.

You want to:

  1. Show the form
  2. Make the text section read-only
  3. Run your piece of code which generates your display text
  4. Make the text section read-write
  5. Add the display text to the text section
  6. Make the text section read-only again

Use a QTextEdit to hold your text.

The command to make the QTextEdit read-only is:

QTextEdit.setReadOnly (self, bool ro)

So in practice this would be:

my_text_edit.setReadOnly(True)

and to change back to read-write:

my_text_edit.setReadOnly(False)
Alan
  • 2,914
  • 2
  • 14
  • 26