Skip to content

Instantly share code, notes, and snippets.

View ejmurray's full-sized avatar

Ernest Murray ejmurray

  • Leeds, UK
  • 02:22 (UTC -12:00)
View GitHub Profile
#!/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.
#!/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):
#!/usr/bin/env python
__author__ = 'Ernest'
import diceware
password_made = diceware.get_passphrase(6, 0, ' ')
print password_made
#!/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"
#!/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)
"""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.
"""
#!/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!"
#!/bin/python3
__author__ = 'Ernest'
# Reading and Writing Files
from sys import argv
script, filename = argv
print("We're going to erase %r." %(filename))
#!/bin/python3
__author__ = 'Ernest'
# Reading and Writing Files
from sys import argv
script, filename = argv
print("We're going to erase %r." %(filename))
#!/bin/python3
__author__ = 'Ernest'
# Reading and Writing Files
from sys import argv
script, filename = argv
print("We're going to erase %r." %(filename))