Re: [Tutor] Need all values from while loop - only receiving one

2018-07-08 Thread Mats Wichmann
On 07/07/2018 03:35 PM, Alan Gauld via Tutor wrote: > On 07/07/18 18:46, Daryl Heppner wrote: > >> I'm stepping back to simply return the DealID from the XML using the >> concept of a class. My code results in exit code 0 but doesn't print >> any results. Could you give me a hint where I'm missi

Re: [Tutor] Need all values from while loop - only receiving one

2018-07-07 Thread Alan Gauld via Tutor
On 07/07/18 18:46, Daryl Heppner wrote: > I'm stepping back to simply return the DealID from the XML using the > concept of a class. My code results in exit code 0 but doesn't print > any results. Could you give me a hint where I'm missing something? You have an issue which has shown up in seve

Re: [Tutor] Need all values from while loop - only receiving one

2018-07-07 Thread Daryl Heppner
Hi Alan, A lot of great guidance here! I'm stepping back to simply return the DealID from the XML using the concept of a class. My code results in exit code 0 but doesn't print any results. Could you give me a hint where I'm missing something? Thank you, Daryl root = tree.getroot() class D

Re: [Tutor] Need all values from while loop - only receiving one

2018-07-04 Thread Alan Gauld via Tutor
On 04/07/18 12:08, Daryl Heppner wrote: > If you have any suggestions for continued self-learning (books, > courses, etc.) I'd appreciate any tips. So far as OOP goes you can't go far wrong with the latest version of Grady Booch's OOAD book. I've read both the previous versions and the latest upd

Re: [Tutor] Need all values from while loop - only receiving one

2018-07-04 Thread Daryl Heppner
Hi Alan, Extremely valuable guidance - thank you! I will be adapting my script once I get to the office but at a first glance, this appears to be exactly what we need! I'll confirm once I've had a chance to implement this. If you have any suggestions for continued self-learning (books, courses,

Re: [Tutor] Need all values from while loop - only receiving one

2018-07-03 Thread Alan Gauld via Tutor
On 04/07/18 01:08, Alan Gauld via Tutor wrote: > # Now the main code just needs the outer loops: > tree = ET.parse(r'\\DealData.xml') > root = tree.getroot() > deals = [] > for deal in root.findall("Deals"): > for dl in deal.findall("Deal"): > deals.append( Deal(dl) ) > > if d

Re: [Tutor] Need all values from while loop - only receiving one

2018-07-03 Thread Alan Gauld via Tutor
On 03/07/18 20:39, Daryl Heppner wrote: > The idea of a class is something I'd unsuccessfully tried but I'm up > for the challenge! I'm very comfortable in Transact SQL but OOP is > new to me. OK, What I meant by using a class was to define one (or more?) that encompassed all the data in one De

Re: [Tutor] Need all values from while loop - only receiving one

2018-07-03 Thread Daryl Heppner
Again thank you so much! I truly appreciate your direction! The idea of a class is something I'd unsuccessfully tried but I'm up for the challenge! I'm very comfortable in Transact SQL but OOP is new to me. Here's my updated code with a sample XML. The full XML file is over 600K rows. I'd app

Re: [Tutor] Need all values from while loop - only receiving one

2018-07-03 Thread Alan Gauld via Tutor
On 02/07/18 23:52, Daryl Heppner wrote: > The two While Loops are the part I'm struggling with. The goal is to > list each bill month number and date for each month in the term. When you need multiple values you need to use a collection type such as a list or tuple. Your problem is that you are u

Re: [Tutor] Need all values from while loop - only receiving one

2018-07-02 Thread Alan Gauld via Tutor
On 02/07/18 21:06, Daryl Heppner wrote: > I'm trying to calculate the amount of rent per lease for the life of > the lease, by month. The following code provides the correct results > except for the monthnum and billper. > The while loop (below) returns the first value correctly but stops > w

[Tutor] Need all values from while loop - only receiving one

2018-07-02 Thread Daryl Heppner
Hi folks, I'm trying to calculate the amount of rent per lease for the life of the lease, by month. The following code provides the correct results except for the monthnum and billper. Monthnum is intended to show the month within the lease and the billper should list each date for rent billing.