Re: indentation messing up my tuple?

2006-02-03 Thread localpricemaps
the, the issue is that the last loop adds the last value of everything to the data array -- http://mail.python.org/mailman/listinfo/python-list

Re: indentation messing up my tuple?

2006-02-01 Thread localpricemaps
i am using a tuple because i am building lists. if i just use (food + drink) then while drink is unique food remains the same do i get this: (burger, coke) (burger, 7up) (burger, sprite) infidel wrote: tuple is the name of the built-in type, so it's not a very good idea to reassign it to

Re: indentation messing up my tuple?

2006-02-01 Thread infidel
i am using a tuple because i am building lists. I don't understand if i just use (food + drink) then while drink is unique food remains the same do i get this: (burger, coke) (burger, 7up) (burger, sprite) I don't understand what you're saying here. food and drink are both strings.

Re: indentation messing up my tuple?

2006-01-31 Thread infidel
tuple is the name of the built-in type, so it's not a very good idea to reassign it to something else. (food + drink + '\n') is not a tuple, (food + drink + '\n',) is There's no reason to use tuples here, just do this: data.append(food + drink) f.write('\n'.join(data)) --

Re: indentation messing up my tuple?

2006-01-28 Thread localpricemaps
sorry i forgot to add in the code for my tuple which is at the very end tuple = (food+ drink + \n) data.append(tuple) f = open(froogle.sql, 'a') f.write ( ''.join( tuple ) -- http://mail.python.org/mailman/listinfo/python-list

Re: indentation messing up my tuple?

2006-01-28 Thread localpricemaps
sorry i left out my tuple which is at the end of my code tuple = (food + drink + \n) data.append(tuple) f = open(froogle.sql, 'a') f.write ( ''.join( tuple ) -- http://mail.python.org/mailman/listinfo/python-list

indentation messing up my tuple?

2006-01-27 Thread localpricemaps
i have the following code which is used to create a tuple of food and drink. if the page i am trying to scrape has a total of 10 food/drink items that i end up getting a nice list of 10 food/drink items in my text file BUT they are all a repeat of the first item so i end up getting a text file

Re: indentation messing up my tuple?

2006-01-27 Thread Steven D'Aprano
On Fri, 27 Jan 2006 16:45:54 -0800, localpricemaps wrote: here is my code: for row in bs('div', {'style' : 'both'}): What is bs? Is it a secret? data=[] for incident in bs('h3', {'class' : 'name'}): foodlist = [] for oText in