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
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
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.
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))
--
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
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
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
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