Python Forum
[PyQt] Newbe question about Print() to PyQt
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] Newbe question about Print() to PyQt
#1
I am looking to porting my python code to PyQt but I don't understand how to "Print()" to a text window. a print fragment of my code is below and it produces this simple user interface screen that I would like to see in a PyQt window instead.

class Start_Up_Display(object):
def __init__(self):
pass

def start(self):
global message
print("\nSWITCH STATUS REPORT")
print("-------------")
num = 0
while num < len(Sw)-1:
screen.show_all_in_line(num)
num = num +1

screen.show_all_in_line(num)


num = 0
if len(message)!= 0:
print("\nMessage: [%s]" % message)
else:
print("\nMessage: ")

message = ''


class Display_Switch(object):
def __init__(self):
pass

def show_all_in_line(self, abb):

print("%s %s %s %s \t@ %s" % ( Sw[int(abb)][0].ljust(3),
Sw[int(abb)][3].ljust(3),
chr(int(Sw[int(abb)][4])),
Sw[int(abb)][1].ljust(14),
Sw[int(abb)][2].ljust(41))
)

Result:

[Image: MRSM.jpg]
Reply


Messages In This Thread
Newbe question about Print() to PyQt - by TimW - Dec-18-2017, 10:32 PM
RE: Newbe question about Print() to PyQt - by TimW - Dec-19-2017, 02:54 AM
RE: Newbe question about Print() to PyQt - by TimW - Dec-19-2017, 05:19 PM
RE: Newbe question about Print() to PyQt - by TimW - Dec-19-2017, 10:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] print an image using PyQt micro 4 2,805 Jan-08-2020, 03:50 PM
Last Post: Denni
  Question regarding python pyqt script cibb 2 2,620 Feb-18-2018, 03:03 AM
Last Post: Raures

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020