Skip to content

Instantly share code, notes, and snippets.

View ejmurray's full-sized avatar

Ernest Murray ejmurray

View GitHub Profile
@ejmurray
ejmurray / ball
Created May 28, 2013 13:13
ball physics form codeskulptor
# ball physics code for generic 2D domain
# the functions inside() and normal() encode the shape of the ennvironment
import simplegui
import random
import math
# Canvas size
width = 600
height = 400
# Note that this script attempts to delete directories (Folders) called 'temp' and 'dateutil'
# within Pythonista as part of installation. It will also overwrite files in directories
# named 'github' and 'githubista'. If you are using Pythonista 1.3 or above please check
# that you have not created any Folders with these names before running this script as
# any files inside them will be irretrievably lost.
import os
import urllib2
import tarfile
import shutil
import traceback
#!/usr/bin/env python
# 2014-01-31
# this is a python game that I will start from scratch
# it is based on a penalty shoot out, but it could be modified
# to be a wwe game for Max!!!!!
print "You are about to take part in a penalty shoot out."
print "You step up to the spot and place the ball."
print "The keeper is looking at you and then smiles!!!"
print "Which of the following do you do?"
#!/usr/bin/env python
# 2014-02-12
# this is a python game that I will start from scratch
# it is based on a WWE match
# most of the ideas will be a conversion of ex32_football.py
# TODO: add the six functions for the options.
from sys import exit
#!/usr/bin/python
import os
import io
import sys
import shutil
import re
import string
from datetime import date, datetime, time
No boost binaries for MSVC 2012 available, so...
Delete all other Python versions other than Python 2.7 (not sure if necessary...)
Unzip Boost 1.49.0 to C:\Boost\boost_1_49_0
cd into it
bootstrap # to create bjam
bjam.exe --with-regex --with-python --with-date_time --with-thread link=shared toolset=msvc-11.0 release install -j4
bjam.exe --with-thread --with-date_time toolset=msvc-11.0 release stage -j4 # Then copy from C:\Boost\boost_1_49_0\stage\lib
#!/usr/bin/python
# encoding: utf-8
"""
here is the docstring
"""
__author__ = 'Ernest'
import pygame
import sys
from pygame.locals import *
@ejmurray
ejmurray / webel_example.py
Created February 18, 2015 14:17
Uses the webel module to search for chemicals.
#!/usr/bin/python
# encoding: utf-8
"""
Output the structure and other information on a chemical that is entered in line 9 of the code.
"""
__author__ = 'Ernest'
from cinfony import webel
mol = webel.readstring("name", "Oestradiol")
print "The molecular weight is %.1f" % mol.molwt
@ejmurray
ejmurray / Solver.py
Created February 18, 2015 14:19
solves the square root of a triangle
import math
__author__ = 'Ernest'
__project__ = "MySimplePythonApplication"
class Solver:
def demo(self):
while True:
a = int(input("a "))
b = int(input("b "))
#!/usr/bin/python
# encoding: utf-8
"""
here is the docstring
"""
__author__ = 'Ernest'
import pygame
import sys
from pygame.locals import *