This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gen_prime_sieve(n): | |
# Implementation uses the Sieve of Eratosthenes | |
# Optimized code from: http://stackoverflow.com/a/3941967/1170681 | |
a = [True] * n | |
a[0] = a[1] = False | |
for (i, isprime) in enumerate(a): | |
if isprime: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import urllib | |
import urlparse | |
from HTMLParser import HTMLParser | |
arg_parser = argparse.ArgumentParser() | |
arg_parser.add_argument('url') | |
args = arg_parser.parse_args() |
NewerOlder