if you are using linux, unix, os x:
pip install -U setuptools
pip install -U pip
pip install numpy
pip install scipy
pip install matplotlib
#pip install PySide
if you are using linux, unix, os x:
pip install -U setuptools
pip install -U pip
pip install numpy
pip install scipy
pip install matplotlib
#pip install PySide
import ast | |
from timeit import repeat | |
import threading | |
from ctypes import pythonapi, c_void_p | |
import math | |
import numpy as np | |
try: | |
import numexpr as ne | |
nthreads = ne.ncores |
from System.Dynamic import DynamicObject as _do | |
from System import Func, Array, Object | |
from System.Runtime.CompilerServices import CallSite | |
from Microsoft.CSharp.RuntimeBinder import ( | |
Binder, CSharpBinderFlags, CSharpArgumentInfoFlags, | |
RuntimeBinderException, CSharpArgumentInfo | |
) | |
class _Injected: |
# +-----------------------------------------------------------------------------+ | |
# | Copyright (C) 2011-2015 | | |
# | Original by Marcel Loose (loose <at> astron.nl) 2011-2013 | | |
# | Modified by Chris Kerr (chris.kerr <at> mykolab.ch) 2013-2015 | | |
# | | | |
# | This program is free software; you can redistribute it and/or modify | | |
# | it under the terms of the GNU General Public License as published by | | |
# | the Free Software Foundation; either version 2 of the License, or | | |
# | (at your option) any later version. | | |
# | | |
import os | |
import pyHook | |
import pythoncom | |
import threading | |
# Requires pyHook: http://sourceforge.net/apps/mediawiki/pyhook/ | |
# Requires pyWin32: http://sourceforge.net/projects/pywin32/ | |
# Kills the process if escape is pressed | |
class EscapeToKill(threading.Thread): |
Example: You have a branch refactor
that is quite different from master
. You can't merge all of the
commits, or even every hunk in any single commit or master will break, but you have made a lot of
improvements there that you would like to bring over to master.
Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.
On master:
> git co -b temp
Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv
instead. If you are looking for the previous version of this document, see the revision history.
$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10
$ pyenv install 2.6.9
#!/usr/bin/env python | |
# The following is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
from pykeyboard import PyKeyboardEvent | |
from pymouse import PyMouseEvent | |
from threading import Thread |
############################################################################## | |
# | |
# Simple Python program to benchmark several Python Excel writing modules. | |
# | |
# python bench_excel_writers.py [num_rows] [num_cols] | |
# | |
# | |
import sys | |
from time import clock |