Re: Controlling the passing of data

2016-04-29 Thread Sayth Renshaw
> because a set avoids duplicates. If you say "I want to document my > achievements for posterity" I would recommend that you print to a file > rather than append to a list and the original code could be changed to > > with open("somefile") as f: > for achievement in my_achievements: >

Re: Controlling the passing of data

2016-04-29 Thread Peter Otten
Sayth Renshaw wrote: > >> >> Your actual problem is drowned in too much source code. Can you restate >> it in English, optionally with a few small snippets of Python? >> >> It is not even clear what the code you provide should accomplish once >> it's running as desired. >> >> To give at least

Re: Controlling the passing of data

2016-04-29 Thread Peter Otten
Sayth Renshaw wrote: > >> >> Your actual problem is drowned in too much source code. Can you restate >> it in English, optionally with a few small snippets of Python? >> >> It is not even clear what the code you provide should accomplish once >> it's running as desired. >> >> To give at least

Re: Controlling the passing of data

2016-04-28 Thread Sayth Renshaw
On Friday, 29 April 2016 01:19:28 UTC+10, Dan Strohl wrote: > If I am reading this correctly... you have something like (you will have to > excuse my lack of knowledge about what kinds of information these actually > are): > > > 1234 > first > > > 5678 > second > > > >

RE: Controlling the passing of data

2016-04-28 Thread Dan Strohl via Python-list
age- > From: Python-list [mailto:python-list-bounces+d.strohl=f5@python.org] > On Behalf Of Sayth Renshaw > Sent: Thursday, April 28, 2016 7:00 AM > To: python-list@python.org > Subject: Re: Controlling the passing of data > > > > > > Your actual problem is

Re: Controlling the passing of data

2016-04-28 Thread Rustom Mody
On Thursday, April 28, 2016 at 8:11:26 PM UTC+5:30, Dan Strohl wrote: > In addition to Peter's points, > - I would suggest breaking out the list comprehensions into standard for > loops and/or functions. That makes it easier to read and troubleshoot. (you > can always re-optimize It if

RE: Controlling the passing of data

2016-04-28 Thread Dan Strohl via Python-list
--- > From: Python-list [mailto:python-list-bounces+d.strohl=f5@python.org] > On Behalf Of Peter Otten > Sent: Thursday, April 28, 2016 6:40 AM > To: python-list@python.org > Subject: Re: Controlling the passing of data > > Sayth Renshaw wrote: > > > In my file here I

Re: Controlling the passing of data

2016-04-28 Thread Sayth Renshaw
> > Your actual problem is drowned in too much source code. Can you restate it > in English, optionally with a few small snippets of Python? > > It is not even clear what the code you provide should accomplish once it's > running as desired. > > To give at least one code-related advice: You

Re: Controlling the passing of data

2016-04-28 Thread Peter Otten
Sayth Renshaw wrote: > In my file here I needed to traverse and modify the XML file I don't want > to restore it or put it in a new variable or other format I just want to > alter it and let it flow onto the list comprehensions as they were. That looks like an arbitrary limitation to me. It's a