Skip to content

Instantly share code, notes, and snippets.

import pywikibot
from collections import defaultdict
AWARDS = {
"Hugo Best Novel": "Q255032",
"Nebula Best Novel": "Q266012",
"Locus Best SF Novel": "Q2576795",
"Philip K. Dick Award": "Q1341487"
}
package main
import (
"encoding/xml"
"fmt"
"github.com/gorilla/feeds"
"github.com/kr/pretty"
"io/ioutil"
"log"
"net/http"
@Horrendus
Horrendus / eu_election_AT_medium_age.py
Created May 26, 2019 20:25
European Election 2019 - Austria - Medium candidate age calculation
# input for other parties can be taken from: https://www.bmi.gv.at/412/Europawahlen/Europawahl_2019/start.aspx#pk_04
def medium_age(party_list):
ages = []
splitted = party_list.split("\n")
lines_splitted = [line.split(" ")[1:] for line in splitted]
for line in lines_splitted:
for token in line:
try:
age = 2019 - int(token)