This file contains hidden or 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 | |
__author__ = 'Ernest' | |
import urllib | |
import xml.etree.ElementTree as ET | |
import cgi | |
import pyperclip | |
import sys | |
# TODO: read the xml file of the article in question to figure out where to add the doi. |
This file contains hidden or 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 | |
__author__ = 'Ernest' | |
import urllib | |
import xml.etree.ElementTree as ET | |
import cgi | |
import pyperclip | |
import sys | |
# TODO: read the xml file of the article in question to figure out where to add the doi. | |
def escapeToHTML(text, escapeQuotes=False): |
This file contains hidden or 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 | |
__author__ = 'Ernest' | |
import diceware | |
password_made = diceware.get_passphrase(6, 0, ' ') | |
print password_made |
This file contains hidden or 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 | |
__author__ = 'Ernest' | |
# scrape http://www.bbc.co.uk/sport/football/fixtures for up and coming matches. | |
from bs4 import BeautifulSoup | |
from urllib2 import urlopen | |
BASE_URL = "http://www.bbc.co.uk/sport/football/fixtures" |
This file contains hidden or 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 | |
__author__ = 'Ernest' | |
# http://goo.gl/uXcUob for the final getting the information from the PubmedID | |
from Bio import Entrez | |
Entrez.email = "[email protected]" | |
for single_term in ["The metabolic fate of 14C-ximoprofen in rats, baboons and humans"]: | |
data = Entrez.esearch(db="pubmed",term = single_term) |
This file contains hidden or 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
"""Tools for searching Pubmed for a list of PMIDs. | |
The goal here is to search for many PMIDs at once, since searching | |
sequentially can take a long time. Using the the BioPython Entrez module | |
is super convenient to this end. | |
The results results are returned in a simple dictionary format. | |
""" | |
This file contains hidden or 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
#!/bin/python3 | |
__author__ = 'Ernest' | |
# Functions and Variables | |
# this is the function that prints out the four lines below the section headings. | |
def cheese_and_crackers(cheese_count, boxes_of_crackers): | |
print "You have %d cheeses!" % cheese_count | |
print "You have %d boxes od crackers" % boxes_of_crackers | |
print "Man that's enough for a party!" |
This file contains hidden or 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
#!/bin/python3 | |
__author__ = 'Ernest' | |
# Reading and Writing Files | |
from sys import argv | |
script, filename = argv | |
print("We're going to erase %r." %(filename)) |
This file contains hidden or 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
#!/bin/python3 | |
__author__ = 'Ernest' | |
# Reading and Writing Files | |
from sys import argv | |
script, filename = argv | |
print("We're going to erase %r." %(filename)) |
This file contains hidden or 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
#!/bin/python3 | |
__author__ = 'Ernest' | |
# Reading and Writing Files | |
from sys import argv | |
script, filename = argv | |
print("We're going to erase %r." %(filename)) |