I am trying to figure out how I can implement my code to allow me to create a tab based on a string list and output each tab with the correct corresponding parameters/data for that tab.
A little background on this program before we keep going. The program is a text/log comparison tool I use to compare many configurations for devices against a default/correct configuration. If there are any parameters that are incorrect with the device when compared it will output the incorrect parameters to let me/user know.
But for the sake of this portion of the code lets just say we're comparing some animals.
Heres a preview of what I currently have has a GUI/Program:
Essentially my goal is to have the <Cat> <Dog> <Bird> <Tiger>
all within their own tab with their data.
The code I have been working with is the following:
with open(compareResults, 'wb') as fdout:
while (count < (len(setNames))):
for number, item in enumerate(lst, 0):
print setNames[count]
fdout.write('{}'.format(setNames[count]) + '\r\n')
for param, correct in correct_parameters.items():
if item.get(param) != correct:
print ('{} = {}'.format(param, item.get(param)))
fdout.write('{} = {}'.format(param, item.get(param)) + '\r\n')
count += 1
The List that holds each name for each animal is setNames[]
If you would like to view the whole code click on the pastebin link; http://pastebin.com/6v86qgj3
My idea was to, somehow, create a loop with setNames
that will allow me to make a tab for each name in setNames
and then output the results to each corresponding name. However, I am not that good with PyQt and I am still trying to figure out how to make individual tabs and if I can even create this without first having to make a function for the tabs or something in this nature. Any help would be much appreciated.