Re: How to extract contents of inner text of html tag?

2014-06-27 Thread Jesse Adam
I don't have BeautifulSoup installed so I am unable to tell whether

a) for line in all_kbd:
processes one line at a time as given in the input, or do you get the clean
text in single lines in a list as shown in the example in the doc 
http://www.crummy.com/software/BeautifulSoup/bs4/doc/#searching-the-tree


b) for inside_line in line:
  Does this process one token at a time? 

In any case, it looks like the reason you got None in the output is 
because you assume that every single line contains code and /code tags.
This may not be case all the time, so, prior to printing extract_code
perhaps you could check whether that is None.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: multiprocessing in a while loop?

2014-06-27 Thread Jesse Adam

Could you post 
a) what the output looks like now (sans the logging part)
b) what output do you expect


In any event, this routine does not look right to me:

def consume_queue(queue_name):
  conn = boto.connect_sqs()
  q = conn.get_queue(queue_name)
  m = q.read()
  while m is not None:
yield m
q.delete_message(m)
logger.debug('message deleted')
m = q.read()
-- 
https://mail.python.org/mailman/listinfo/python-list