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
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" | |
} |
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
package main | |
import ( | |
"encoding/xml" | |
"fmt" | |
"github.com/gorilla/feeds" | |
"github.com/kr/pretty" | |
"io/ioutil" | |
"log" | |
"net/http" |
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
# 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) |