tinker Form question(s)

Steve Gronicus at SGA.Ninja
Mon Sep 7 03:20:40 EDT 2020


I am not sure how to post the code for my file here, is copy/paste the best
way? Is there another? I understand that attachments are stripped off.

"""
The following segment of code returns values of "spec".
I would like to have it return the associated value of
"DataLine" with each spec. It would also be nice to understand 
how this code works to hold/return the information.

In pseudocode, a line something like:

        DataReturned = DataLine + " " + spec)
        New_Specs.append(DataReturned)
        
explains what I would like to have returned.


"""
     New_Specs = []
     OldSpec = ItemID 
     NewSpec = " "
     OldLine = ItemID
     x = 3
     y = 0
         
     for lineItem in range(len(ThisList)):
         DataLine, Spec = GetLineByItem(ThisList[y])
         
         SVRlabel = ttk.Label(window, width = BoxWidth1, text = DataLine)
         SVRlabel.grid(column = 1, row = x,  sticky=tk.W)
         
         SVRlabel = ttk.Label(window, width = BoxWidth2, text = Spec)
         SVRlabel.grid(column = 2, row = x)

         NewSpec = tk.StringVar()
         New_Specs.append(NewSpec)
          
         SVRCodeEntered = ttk.Entry(window, width = BoxWidth3, textvariable
= NewSpec)
         SVRlabel = ttk.Entry(window, width = BoxWidth3, textvariable =
NewSpec)

         SVRlabel.grid(column = 3, row = x, pady = 5, sticky=tk.W)
         
         SVRCodeEntered.grid(column = 3, row = x, pady = 5, padx = 15,
sticky=tk.W)
         SVRCodeEntered.insert(0, OldSpec)
         
         x += 1 
         y += 1    

     return ([spec.get()for spec in New_Specs])

==========
Steve
=================
Footnote:
Some mornings it just isn't worth chewing through the leather straps.




More information about the Python-list mailing list