Re: [Tutor] Where am I mistaken? (exec not working as I expect)

2017-03-13 Thread Steven D'Aprano
Hello Francesco, and welcome! My comments below. On Sun, Mar 12, 2017 at 11:48:35PM +0100, Francesco Loffredo via Tutor wrote: > I did only find a way to access the current document, but that's > all. Armed with that, and hoping to find some field names, I wrote a > small routine to inspect the

Re: [Tutor] Problem on parsing data

2017-03-13 Thread David Rock
> On Mar 13, 2017, at 16:19, jarod_v6--- via Tutor wrote: > > > What can I do for parse better that file and Have only the comma outside the > string ? > I recommend using the cvs module rather than try to write your own. https://docs.python.org/2/library/csv.html — David Rock da...@gran

[Tutor] Problem on parsing data

2017-03-13 Thread jarod_v6--- via Tutor
I have a csv file with "," as separator. If I try to separate using ",": I have many different rows some with 30 columns some with 50 depend on many "," In [105]: dimension_columns = [] In [106]: with open(nomi) as f: for i in f: lines = i.rstrip

Re: [Tutor] While until the end of a list

2017-03-13 Thread Peter Otten
Toni Fuente via Tutor wrote: > Hi, > > I've got this script that goes through an httpd conf file, and gets the > related bits of it for a site, and writes a new config with values that > I am interested. The problem is that it finds the first chunk and > returns it, but I need to go to the end of

Re: [Tutor] While until the end of a list

2017-03-13 Thread Mats Wichmann
On 03/13/2017 10:48 AM, Toni Fuente via Tutor wrote: > * David Rock [2017-03-13 11:28:57 -0500]: >> You just need to make a list or a dict to store the information for each >> site, and add the results to it. If you use a list, it would be >> list.append(), for example. >> >> I don’t really fo

Re: [Tutor] While until the end of a list

2017-03-13 Thread Toni Fuente via Tutor
* David Rock [2017-03-13 11:28:57 -0500]: > > On Mar 13, 2017, at 10:54, Toni Fuente via Tutor wrote: > > > > Hi, > > > > I've got this script that goes through an httpd conf file, and gets the > > related bits of it for a site, and writes a new config with values that > > I am interested. The

Re: [Tutor] While until the end of a list

2017-03-13 Thread David Rock
> On Mar 13, 2017, at 10:54, Toni Fuente via Tutor wrote: > > Hi, > > I've got this script that goes through an httpd conf file, and gets the > related bits of it for a site, and writes a new config with values that > I am interested. The problem is that it finds the first chunk and > returns i

[Tutor] While until the end of a list

2017-03-13 Thread Toni Fuente via Tutor
Hi, I've got this script that goes through an httpd conf file, and gets the related bits of it for a site, and writes a new config with values that I am interested. The problem is that it finds the first chunk and returns it, but I need to go to the end of all chunks list, because there are also s