def test(url):
    print 'TESTING', url
    print '=' * 80
    pt = parse.tree_from_url(url)
    print parse.header_data(pt)
    print
    for elem in parse.items(pt):
        pprint_dict(elem)
    print
def test(url):
    print 'TESTING', url
    print '=' * 80
    pt = parse.tree_from_url(url)
    print parse.header_data(pt)
    print
    for elem in parse.items(pt):
        pprint_dict(elem)
    print
Example #3
0
def generate_page(feed_url, outpath):
    "Renders the contents of an RSS feed into the given HTML file."
    tree = parse.tree_from_url(feed_url)
    if os.path.exists(outpath):
        os.remove(outpath)
    with codecs.open(outpath, 'a', 'utf-8') as f:
        write_preamble(f, feed_url)
        write_header(f, parse.header_data(tree))
        write_items(f, parse.items(tree))
        write_conclusion(f)
# Imported modules
import parse as p

f = input("Please input a file. > ")
cell = int(
    input(
        "Which column contains the data you would like counted? e.g.[1,2,3...] > "
    )) - 1

parsed = p.parse_csv(f)
data = p.pull(parsed, cell)
print(p.items(data))