Category Archives: python

high performance python tips Quoted from  I/O bound problems can make good use of multi-threading (where the GIL is released during I/O) or asynchronous programming. CPU-bound problems can be addressed by better algorithms (nothing beats an algorithm with less computational complexity), using … Continue reading

Posted in python | Tagged | Leave a comment

how to install pymssql

You need to install the FreeTDS development package (freetds-dev) before trying to install pymssql with pip: $ sudo apt-get install freetds-dev and then download and install the latest version of pymssql (don’t use pip install as the version in PyPi … Continue reading

Posted in mssql, pymssql, python, Uncategorized | Leave a comment

python_path SublimeRope

Please add the following lines on a project base. .rope/ prefs.add(‘python_path’, ‘/home/myhome/.virtualenvs/py27/lib/python2.7/site-packages’) prefs.add(‘python_path’,’/usr/lib/python2.7′)

Posted in python, sublime | Leave a comment

python for loop, iterator, iterable, generator

For Loop When Python executes the for loop, it first invokes the __iter__() method of the container to get the iterator of the container. It then repeatedly calls the next() method (__next__() method in Python 3.x) of the iterator until the iterator raises a StopIteration exception. Once the … Continue reading

Posted in python | Leave a comment

cProfile pstats


Posted in python | Leave a comment

osx python set up

Install Python from homebrew install homebrew: ruby <(curl -fsSkL install latest Xcode ‘s command line tool from /usr/local/bin/pip install virtualenv virtualenvwapper brew install python python3   .bashrc export WORKON_HOME=$HOME/.virtualenvs source /usr/local/bin/ mkvirtualenv -a /Users/vyang/src/app -r /Users/vyang/src/app/requirements.txt app

Posted in osx, python | Leave a comment

concurrency model with Actor

Actor model everything is a Actor, natively concurrent. Support in programming language Erlang: language level. Erlang is the best platform for concurrency and distributed application so far. Python eventlet why gevent Gevent: good, bad and ugly gevent tutorial Java: library level. Akka

Posted in erlang, eventlet, gevent, java, python | Leave a comment