Re: [Tutor] Loop not iterating

2015-06-28 Thread Steven D'Aprano
Hi Nym, and welcome, On Sun, Jun 28, 2015 at 07:32:40PM +, Nym City via Tutor wrote: [...] > for domain in domainLists: > something = ("www." + str(domain)) > print(something) > > My program reads in a CSV file that has 500 list of domains. However, > when I save the output of my loop

Re: [Tutor] Loop not iterating

2015-06-28 Thread Mark Lawrence
On 28/06/2015 20:32, Nym City via Tutor wrote: Hello, I am working on my second program and its a two part progam that I want to design However, i am not sure what silly mistake I am making on the first part: Here is my code: | 2 3 4 5 6 7 | import csv domains = open('top500domains.csv') domain

Re: [Tutor] removing nodes using ElementTree

2015-06-28 Thread Alan Gauld
On 27/06/15 01:03, street.swee...@mailworks.org wrote: I'm trying to merge and filter some xml. This is working well, but I'm getting one node that's not in my list to include. This may be similar to a recent post with similar issues. for rec in xmlet: if rec.find('part').find('pid').t

Re: [Tutor] Loop not iterating

2015-06-28 Thread Alan Gauld
On 28/06/15 20:32, Nym City via Tutor wrote: import csv domains = open('top500domains.csv') domainsReader = csv.reader(domains) domainLists = list(domainsReader) for domain in domainLists: something = ("www." + str(domain)) You overwrite something each time round the loop. print(somethi

[Tutor] removing nodes using ElementTree

2015-06-28 Thread street . sweeper
Hello all, I'm trying to merge and filter some xml. This is working well, but I'm getting one node that's not in my list to include. Python version is 3.4.0. The goal is to merge multiple xml files and then write a new one based on whether or not is in an include list. In the mock data below,

[Tutor] Loop not iterating

2015-06-28 Thread Nym City via Tutor
Hello, I am working on my second program and its a two part progam that I want to design However, i am not sure what silly mistake I am making on the first part: Here is my code: | 2 3 4 5 6 7 | import csv domains = open('top500domains.csv') domainsReader = csv.reader(domains) domainLists = list(