Skip to content

Instantly share code, notes, and snippets.

View csgallego's full-sized avatar

Cecile Gallego csgallego

  • ICIJ
  • Washington, DC
View GitHub Profile
import os
import dataset
import requests
import thready
import datetime
YEARS = range(2000, datetime.datetime.now().year + 1)
MAX = 500000
engine = dataset.connect('sqlite:///rednotices.sqlite3')
notices = engine['notices']
@pdpinch
pdpinch / battleship.py
Created October 30, 2012 00:58
Codecademy Battleship game
import random
board = []
for x in range(0,5):
board.append(["O"] * 5)
def print_board(board):
for row in board:
print " ".join(row)
@cesther
cesther / simplesel.py
Created September 8, 2011 23:19
Simple Python Selenium webdriver example
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
def selectOption(select,texttoselect):
options = select.find_elements_by_tag_name("option")
if options:
for o in options:
if o.text == texttoselect: