Skip to content

Instantly share code, notes, and snippets.

@slee0
slee0 / Julia_Python_perf.ipynb
Created February 12, 2016 13:20 — forked from jfpuget/Julia_Python_perf.ipynb
An exercise in Python optimization: make Python benchmarks as fast, if not faster, than Julia.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@slee0
slee0 / pickle_serial.py
Created December 9, 2012 02:51
[python] Simple pickle serialization example
# Pickle Serialization, input and output
try:
import cpickle as pickle
except ImportError:
import pickle
def create_pyp(fname_pickle):
d0 = {
'test0': 0.,
@slee0
slee0 / py_fileexist.py
Created September 24, 2012 18:48
[python] Checking file existence
# from http://stackoverflow.com/questions/82831/how-do-i-check-if-a-file-exists-using-python
try:
fh = open('whatever.txt')
except IOError as e:
print("({})".format(e))