how to start python project on github

steps are: install cookiecutter: python -m pip install cookiecutter run cookiecutter to initiate a project: cookiecutter('https://github.com/audreyr/cookiecutter-pypackage.git') under the project folder on github, start a new repo python_prj run git init in the local project folder and commit run git remote add origin git@github.com:username/projectname.git using git@git requires to setup the ssh key pair, this can be found by easily google it or under FAQ of github run git push -u origin master...

June 14, 2016 · 1 min · Shelper

elisp notes

quote for symbols: (setq symbol) ;; is equivelent to (set 'symbol) the quote means; keep as it is, dont try to evaluate, so if no quote, the lisp processor will try to evaluate it, means the symbol (or the first element of the list) has to be evaluatable as either a function, or a defined variable let vs. let*: (setq y 2) (let ((y 1) (z y)) (list y z)) ⇒ (1 2) (setq y 2) (let* ((y 1) (z y)) (list y z)) ⇒ (1 1) let* binds 1 to y immediately, while let evaluate old y as 2, then list binds 1 to the new y and pring it out...

June 13, 2016 · 1 min · Shelper

install pyqt on mac for matplotlib

so i was trying to use matplotlib for fast image ploting and updating, and I found a post here. the matplotlib uses different backend to render the images, and due to the differences between different backend, some functions are only available for specific backend, for instance, the fig.canvas.update() is a fast way to render new images to the axes, but is only availabe to PyQt4. so i was trying to install pyqt4 using homebrew, it failed by saying the osx version is pre-released version and is not supported, and arises 2 errors during make process....

June 13, 2016 · 2 min · Shelper

matplotlib backend issue

using different backends for matplotlib might cause some unexpected issues: today, i am trying to run a program that uses the following function: plt.figure() figManager = plt.get_current_fig_manager() figManager.window.showMaximized() however, i found when using the backend of Tk, it gives error, saying get_current_fig_manager is not available, so when i switch to qt4egg, everything works well. how to switch the backend for matplotlib? first find the configure directory for matplotlib on your computer...

June 13, 2016 · 2 min · Shelper

python module and packaging

several things: when using setuptools.find_packages, only packages with __init__.py in its folder will be found only modules imported in the __init__.py will be indexed, means the modules will be added into the dir(module) and accessable by .module_name for python 3, if one modules(py file) in the same folder of another module and relies on that module, you need to put from . import module at the top package name is specified in the setup....

June 13, 2016 · 1 min · Shelper